You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Naresh Sharma <na...@yahoo.com> on 2001/10/07 04:31:47 UTC
Flushing Appender buffer
Hello Everybody,
I am using RollingFileAppender in my EJB application. I set the immediateFlush to false, so it log messages needn't flushing each time but when my application closes, all the pending messages from buffer should be flushed.
I didn't find any flush() method but there is a method setImmediateFlush(boolean) which sets immediateFlush option.
So i thought about this solution :
appender.setImmediateFlush(true)
// Put some dummy message in the log buffer so while logging this message previous buffer contents will also get logged.
cat.debug("Dummy message");
Is there any other better way of doing this ??
Thanks
Naresh