Hopefully this is an easy question which has already been asked (and
answered) before.
I searched online, but could not find a reasonable answer...
 
Is there a way to change the default log level of a logger via C#
program control?
 
I don't need the setting to persist, so I don't want to have to change
the XML config file and re-read it.
 
In my C# code, I have a ILog variable that we use for all logging,
defined as follows:
 
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMeth
od().DeclaringType);
 
I'd like to be able to somehow be able to use that 'log' variable, and
set it's log level (INFO, WARN, ERROR, OFF, ALL, etc) to whatever I want
in the code.
 
 
Any help or pointers to useful examples would be appreciated!
 
Thanks,
-esr
 
 
 
Eric Rose
Software Engineer
Product Development

[email protected] <mailto:[email protected]> 
Phone :(978) 936-1858
Cisco Systems, Inc.
500 Beaver Brook Road
Boxborough, MA 01719

www.cisco.com <http://www.cisco.com> 
 
 
 

<<image001.gif>>

Reply via email to