logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28647] - Add "Flush on Level" capability to FileAppender
Date Thu, 06 May 2004 04:32:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28647>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28647

Add "Flush on Level" capability to FileAppender





------- Additional Comments From paul.smith@lawlex.com.au  2004-05-06 04:32 -------
Yup, this is where the (smarter) FlushingWriterAppender would not actually 
buffer any events, just write them to the wrapped WriterAppender and 
periodically call writerAppender.flush() as it deems appropriate.

So via the decorator approach, you could have a generic flushing appender (akin 
really to the Async appender), and one optimised to dealing with 
WriterAppenders.

With the decorator approache you could then do something like:

Appender a = new FlushingAppender(new FlushingWriterAppender(new WriterAppender
(...), 50), 500);

Lets say that in this example:

* FlushingAppender: 500 = # ms to buffer events before flushing to it's 
internal appender (FlushingWriterAppender)

* FlushingWriterAppender: 50= # of event objects to write before calling 
writerAppender.flush().

Having said all of this though, one does need to think about the risks of some 
events not getting written.  While you may have a JDK hook to listen for a 
shutdown, some applications  won't always exit quite so gracefully.  And this 
is usually when you MOST want to know what was going on......

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


Mime
View raw message