Kevin Wittmer
2004-01-16 23:55:57 UTC
Hello,
I am hoping that someone can rattle off a couple of lines of code that would
show me how to programmatically set the logger level.
If I want to accomplish the following:
<appender>
<evaluator type="log4net.spi.LevelEvaluator">
<param name="Threshold" value="WARN"/>
</evaluator>
</appender>
In C# using the various log4net interface and classes, etc. How can this be
done?
My application currently includes the following:
log4net.Appender.RollingFileAppender fileAppender =
new log4net.Appender.RollingFileAppender(
new log4net.Layout.PatternLayout(
"%d [%t] %-5p %c - %m%n"), log4netFile);
fileAppender.MaxFileSize = 65536;
fileAppender.MaxSizeRollBackups = 3;
log4net.Config.BasicConfigurator.Configure(fileAppender);
Thanks! Maybe we could use the reply(s) from this posting to update the
log4net documentation to include such an example. Or, maybe the solution to
this could make its way into the log4net FAQ.
Kevin
_________________________________________________________________
Get a FREE online virus check for your PC here, from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
I am hoping that someone can rattle off a couple of lines of code that would
show me how to programmatically set the logger level.
If I want to accomplish the following:
<appender>
<evaluator type="log4net.spi.LevelEvaluator">
<param name="Threshold" value="WARN"/>
</evaluator>
</appender>
In C# using the various log4net interface and classes, etc. How can this be
done?
My application currently includes the following:
log4net.Appender.RollingFileAppender fileAppender =
new log4net.Appender.RollingFileAppender(
new log4net.Layout.PatternLayout(
"%d [%t] %-5p %c - %m%n"), log4netFile);
fileAppender.MaxFileSize = 65536;
fileAppender.MaxSizeRollBackups = 3;
log4net.Config.BasicConfigurator.Configure(fileAppender);
Thanks! Maybe we could use the reply(s) from this posting to update the
log4net documentation to include such an example. Or, maybe the solution to
this could make its way into the log4net FAQ.
Kevin
_________________________________________________________________
Get a FREE online virus check for your PC here, from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963