This requires me to have access to ch.qos.logback.classic when writing code. It does not allow me to switch loggers out without changing code.
How about LoggerContext.stop()? It looks as if it's designed specifically for this purpose. It recursively stops and detaches all appenders, amongst other things.(You can cast the result of LoggerFactory.getILoggerFactory() to a LoggerContext).
On 28 Sep 2010, at 21:53, Michael Schall wrote:Great question! I asked this on stackoverflow a while back with no
real answers...
http://stackoverflow.com/questions/3678755/do-i-need-to-flush-events-when-shutting-down-using-logback
On Tue, Sep 28, 2010 at 3:32 PM, Chris <shef31@yahoo.com> wrote:I'm using file appenders. At a certain point in my app, a little before
shutdown, I have to close all loggers.How do I tell logback to call stop() on all appenders?_______________________________________________Logback-user mailing listLogback-user@qos.ch
http://qos.ch/mailman/listinfo/logback-user_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://qos.ch/mailman/listinfo/logback-user