I'm interested in creating a mechanism to have a system-wide
configuration file for all .NET applications using log4net.  I'd like
all logging statements from various web applications and other .NET
services to be managed via one configuration file.  I haven't found a
good way to do that with the existing code base.  I've used log4j for
years, and have always passed "-Dlog4j.configuration=..." into my
application startup.  There doesn't seem to be a similar mechanism in
log4net.

I'm considering a couple options for addressing this, and I'd
appreciate any recommendations or feedback.

* Create an ConfiguratorAttribute class that looks for an environment
variable ("log4net.configuration") in order to locate the log4net
configuration file.
* Create a ConfiguratorAttribute class that retrieves config file
location from a machine.config appSettings key (e.g. <add
key=3D"log4net.configuration" value=3D"file:///C:/log4net.xml" />)
* Update the XmlConfigurator to use one or both of these methods for
finding the configuration details.

Any thoughts on the best way to proceed?

Thanks,
Pat.

Reply via email to