You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by shelby pereira <sh...@gmail.com> on 2007/03/26 13:25:27 UTC

buffering appender :auto flush as a function of logging level?

Hello, I have a feature request for the buffering appender.

It would be nice to have a way to state in the config file that we would
like all levels above a certain level to be flushed automatically for the
buffering appender.

For example, in some applications logging at the Error level or Fatal levels
represents critical information, so it would be nice to flush these
automatically.

cheers,
shelby

RE: buffering appender :auto flush as a function of logging level?

Posted by ni...@apache.org.
If you are using a BufferingForwardingAppender to buffer messages in
memory before sending them all to an appender, i.e. in non-lossy mode.
You can used the <evaluator> to control when the buffer should be
immediately sent.

See the second example for the BufferingForwardingAppender on:
http://logging.apache.org/log4net/release/config-examples.html#buffering
forwardingappender

This example is actually setup in lossy mode, but will work fine if
<lossy value="false" />.

Cheers,
Nicko

> -----Original Message-----
> From: shelby pereira [mailto:shelby.pereira@gmail.com] 
> Sent: 26 March 2007 12:25
> To: Log4NET User
> Subject: buffering appender :auto flush as a function of 
> logging level?
> 
> Hello, I have a feature request for the buffering appender.
> 
> It would be nice to have a way to state in the config file 
> that we would like all levels above a certain level to be 
> flushed automatically for the buffering appender. 
> 
> For example, in some applications logging at the Error level 
> or Fatal levels represents critical information, so it would 
> be nice to flush these automatically.
> 
> cheers,
> shelby
> 
>