Programmatic Level Control of Root
"Kristofer Goss" <[email protected]> Thu, 04 Nov 2004 16:14:59 -0700
| Newsgroups | gmane.comp.windows.dotnet.log4net.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm using log4net v.1.2.0.33710 currently. I have a simple web app, it has 3 appenders configured with the root set to FATAL when running. In the web app, if a request comes in with a "log token" I'd like to enable INFO level logging for the lifetime of the request using NDC.Push/Pop. When I attempt to override my root log level, the current ILog references remain unchanged. Thus far, I followed the pattern from the docs to obtain an ILog instance of: static readonly ILog log = LogManager.GetLogger( typeof(MyType) ) Using infromation from posts like: http://sourceforge.net/mailarchive/message.php?msg_id=5506984 http://sourceforge.net/mailarchive/message.php?msg_id=5514263 I'm unable to update my ILog instance so that INFO is enabled. Although the root is updated, it seems independent from the ILog instance. Perhaps caching the ILog instance in a static member variable is not a viable approach given this functionality? Any help is greatly appreciated! Thanks, Kris ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click