You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ken Arnold <ar...@moonhill.org> on 2002/10/25 19:08:31 UTC
Re: BufferAppender and CyclicBuffer
Just catching up here.
I posted a similar thing which you might also want to look at. For
reference:
Source http://marc.theaimsgroup.com/?l=log4j-user&m=102875255312490&w=2
Bug fix http://marc.theaimsgroup.com/?l=log4j-user&m=102881132725686&w=2
Feedback http://marc.theaimsgroup.com/?l=log4j-dev&m=102882827915720&w=2
We've been using this successfully in house for some months now. (Some
other bug fixes are in there, but it is substantially the same -- will
post fixes if anyone wants them.)
Ken
On Friday, September 27, 2002, at 04:04 AM, Ole Bulbuk wrote:
> 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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>