logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Bulbuk <Ole.Bul...@ebp.de>
Subject BufferAppender and CyclicBuffer
Date Thu, 26 Sep 2002 14:16:49 GMT
Hi,

I have just downloaded Log4J 1.2.6 and have made a simple BufferAppender.
This is storing log events in a cyclic buffer and overwrites the oldest log
event when a new one is appended. The whole buffer and the new message are
forwarded to a subappender if the new log event has got a priority that is
high enough.

This means one won't get all the debug and info messages in the log (so the
log would keep small and clean) unless a log event with a priority that is
high enough (e.g. ERROR) occurs. Then the log will contain not only the
error itself but its history too.

The class has got only one small error:
If the size is decreased while the buffer is full the oldest messages remain
in the buffer instead of the newest ones. This is because
helper.CyclicBuffer is used internally.
I would be willing to change this if nobody objects. What is CyclicBuffer
used else for?

I would donate the BufferAppender to the project if you are interested.

Regards,

Ole

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


Mime
View raw message