[logback-user] Flushing Buffer

Greg Flex greg.flex at gmail.com
Tue Apr 21 22:31:18 CEST 2009


Hi Ceki,
I'm getting no replies from Log4J guys so I thought I ask you....
I'm trying to change the appender (read from the config file) from Console
to File at runtime.
and I'm doing it by calling the DOMConfigurator.configure(String file)
I'm getting some unexpected results however that I'm not sure how to fix.
The Console appender does its job and the log messages are printed to the
console as expected.
(let say I'm printing only 5 log messages)
Then I re-read the config file (by calling the above stated
DOMConfigurator.configure(newConfigFile) method)
that has a File appender in it. (another set of 5 log messages should be
written to the file.)
What I see in the file are 10 messages not 5....
The ones that I printed earlier to the console plus 5 new ones - after I
changed the appender.
I'm guessing that there is some kind of buffer that temporarily stores these
log messages. Is there?
How can I clear it so that when I re-read my config file with different
appender, previous log messages (if any)
won't be wrriten there?
Any suggestion?
Thanks
Greg.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090421/03b749ea/attachment.htm>


More information about the Logback-user mailing list