Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 467681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:36:22+00:00 2026-05-12T23:36:22+00:00

So, I have log4net configuration in log4net.config file and I don’t want to include

  • 0

So, I have log4net configuration in log4net.config file and I don’t want to include it in the web.config. I initialize configuration in Application_Start like this

   log4net.Util.LogLog.InternalDebugging = true;
   log4net.Config.XmlConfigurator.Configure(new FileInfo("log4net.config"));

But looking at the output window I see this

'WebDev.WebServer.exe' (Managed): Loaded 'Builders023dc0f3207c463dbe9f49f346e5a7ca.dll'
log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [log4net.config]
log4net: XmlConfigurator: config file [C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\log4net.config] not found. Configuration unchanged.

I cannot figure out how to provide a path to the config file so that it is not hardcoded and is relative. I tried (“../log4net.config”), (“~/log4net.config”) etc. Is Server.MapPath only option?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:36:23+00:00Added an answer on May 12, 2026 at 11:36 pm
    Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, configFileName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I have this configuration in my web.config <log4net> <appender name=LogFileAppender type=log4net.Appender.FileAppender> <param name=File
We are using log4net and want to specify it's configuration in an external config
I currently have the log4net config in the applications' app.config file, as such: ...
I have a Log4Net RollingFileAppender that is configured as: <configuration> <configSections> <section name=log4net type=log4net.Config.Log4NetConfigurationSectionHandler,
I have been attempting to get log4net logging in my asp.net web application with
We have an application that logs using log4net. But we would like to delete
I have some troubles while writing logs from log4net to the file. I seem
I have downloaded the source code and using this logview to view log4net logs.
Odd one this. I am using NHibernate with one website. I have configured log4net
I have an empty app.config file, but I still get NHibernate debug logs NHibernate:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.