I have a project I am working on using log4net, and it works great, but I want to know if i can override the XML configuration for the root "level" attribute for the logging when in debug and release.
Currently my root configuration looks like:
<root>
<level value="WARN"/>
<appender-ref ref="LogFileAppender"/>
<appender-ref ref="DebugAppender"/>
</root>
And in my web applications Global.asax class, I was thinking I could wrap something in a
protected override void Application_Start(object sender, EventArgs e) {
base.Application_Start(sender, e);
XmlConfigurator.Configure();
#if DEBUG
//Change logging level to DEBUG
#endif
}
To change the root logging level to debug when the solution is built in debug.
Is this possible, is my idea a best-practises type soltuion to what I want, and how would I do it (or how would you do it better)?