logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <mwom...@apache.org>
Subject RE: BufferAppender and CyclicBuffer
Date Fri, 27 Sep 2002 09:05:50 GMT

I did a quick search, and the only class in the log4j library that appears to be using CyclicBuffer
is o.a.l.net.SMTPAppender.

Just so we understand what you are proposing:

1) A patch to CyclicBuffer that when resized to a smaller buffer size, keeps the newest messages
instead of the oldest.
2) A new BufferAppender.

Have I got that right?

We are always interested in patches and code that log4j users/developers think are useful.
 No one needs permission to post submissions to this forum.  If they feel their change is
really important, they might need to prod/politic us committers to "see the light" and apply
their changes, but obviously useful code will not be turned down.  Though, it might take some
time and review...:-).

So, please post your code.


> -----Original Message-----
> From: Ole Bulbuk [mailto:Ole.Bulbuk@ebp.de]
> Sent: Friday, September 27, 2002 1:04 AM
> To: 'Log4J Developers List'
> Subject: BufferAppender and CyclicBuffer
> Hi,
> I have downloaded Log4J 1.2.6 yesterday 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:   
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

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

View raw message