[logback-user] More on stopping loggers

Chris shef31 at yahoo.com
Thu Sep 30 19:32:33 CEST 2010


My app needs to stop a logger every once in a while, close the file it's 
writing to, and later in the app reopen the file and start logging again.

This means that we need a logger close() method, so a subsequent call to 
getLogger() will behave as if the logger is being fetched for the first 
time.

As far as I can tell, this is impossible with logback. The reason is 
that the configuration file which defines the loggers is read once on 
startup and never touched again, which means it can't be reused to 
create another instance of the logger.

Is this correct?



More information about the Logback-user mailing list