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

Reply via email to