We use:

LogConfig = Server.MapPath(".") +
ConfigurationSettings.AppSettings["LogConfigURL"];
DOMConfigurator.Configure(new System.IO.FileInfo(LogConfig));

To set the name of the config file as a setting in the web.config. You
can make the setting whatever you like...

Erik


-----Original Message-----
From: Simon Wallis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 1:01 PM
To: [email protected]
Subject: dynamically get config filename

I would like to dynamically determine the log4net config filename. I
tried log4net.helpers.SystemInfo.ConfigurationFileLocation (seen in
DOMConfigurator.cs) but it gives me the wrong info. It gives me
"web.config", but I'm using "<assemblyname>.dll.log4net" as the config
filename.

I have this code in my Global.asax.cs:
[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",
Watch=true)]

I need to determine the config filename because I'm writing a page to
sit on the production servers that will allow us to update the config
file, should we need to change the log level.

Thanks,
Simon.


DISCLAIMER:
This message is intended for the sole use of the addressee, and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not the addressee you are hereby notified that you 
may not use, copy, disclose, or distribute to anyone the message or any 
information contained in the message. If you have received this message in 
error, please immediately advise the sender by reply email and delete this 
message.

Reply via email to