logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Change logging level with a trigger
Date Thu, 25 Aug 2005 15:04:18 GMT
Jason,

> We only want to log info messages and above, but if a warning 
> or above is encountered, we want it to output the last x 
> number of messages.

When you say last x messages, do you mean of only Info and above?
If so then just set the logger level to Info.

<root>
	<level value="Info" />
	<appender-ref ...>
</root>


> The buffered file appender looks like it 
> almost does this, but not quite.

Where do you want the log messages to go? file, email etc...


> We've also been able to log all messages, but send an email 
> on error messages with the buffer.

If you want to trigger sending the buffer on Warn events then you need
to specify a threshold value on the Evaluator of the
BufferingForwardingAppender.

<evaluator type="log4net.Core.LevelEvaluator">
	<threshold value="Warn" />
</evaluator>


> Does someone have an example config file that I could see?
> 
> If you need more clarification, or want to see where I got 
> stuck, please let me know.

Why don't you post the log4net configuration you currently have.

Cheers,
Nicko

> 
> Thanks,
> Jason
> 

Mime
View raw message