You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Alan Brown <ab...@opstechnology.com> on 2003/11/10 20:34:51 UTC

caching...

I'd like to only log debugging messages if a warning or error occurs
shortly afterwards.  In the past I've written my own logging systems
that have cached messages and then logged the last x debug messages to
file if an error occurs.

Is there a way to do this with Log4J or would I have to write my own
caching mechanism in front of the logger?



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: caching...

Posted by Ken Hoying <ke...@yahoo.com>.
Most appender support the BufferSize property which
does exactly what you describe.  Beware that in order
to ensure that the buffer get cleared when the system
exits, you generally have to make a call to
LogManager.shutdown().

--- Alan Brown <ab...@opstechnology.com> wrote:
> I'd like to only log debugging messages if a warning
> or error occurs
> shortly afterwards.  In the past I've written my own
> logging systems
> that have cached messages and then logged the last x
> debug messages to
> file if an error occurs.
> 
> Is there a way to do this with Log4J or would I have
> to write my own
> caching mechanism in front of the logger?
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> log4j-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org