logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Arnold <arn...@moonhill.org>
Subject circular buffering
Date Wed, 07 Aug 2002 03:34:07 GMT
I need a circular buffered appender -- one that tracks the last N 
messages so when something goes wrong I can dump out those.  The idea is 
that the circular buffer can take debug-level messages, but you don't 
see them until there is a problem, when only the N most recent ones are 
likely to be valuable.

Has anyone already done this?  I've started to code this up, and run in 
to the interesting problem of how to get my hands on these appenders to 
flush them when that's needed.  (I'm assuming here that they are created 
from configuration, not explicitly in code.)  The best I can figure out 
is a static call that is given one logger, and then scrounges through 
the tree finding and flushing these buffering appenders.  (I'm walking 
up the tree from the logger looking for appenders until either I hit the 
top or something that isn't additive; then  because I can't figure out 
how to walk down the three I'm looking through all the loggers for those 
that are descended from the specified logger without an intervening 
non-additive logger.  This means that flushing from the root gets all 
loggers not blocked by non-additives, for example.)

Any thoughts are welcome.  I will obviously post the thing when I'm done 
in case anyone else wants it.


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

View raw message