[logback-dev] Re : stop() and start() on LoggerContext

Mathieu Stempell dma-sc at gmx.fr
Thu Feb 21 15:15:21 CET 2013


Replying to myself as i found the solution over the web.

I had to call LoggerContext reset() and then ContextInitializer autoConfig() for the logging to be effective again after LoggerContext stop() & start(), as described here : http://stackoverflow.com/a/3810936

Mathieu
----- Message d'origine -----
De : Mathieu Stempell
Envoyés : 20.02.13 15:28
À : logback-dev at qos.ch
Objet : [logback-dev] stop() and start() on LoggerContext

Hello,

When i call start() method on LoggerContext after i called stop(), i doesn't log anything new in the output files :
-----------
 LoggerContext loggerContext = (LoggerContext)LoggerFactory.getILoggerFactory();
 LoggerFactory.getLogger(AbstractTest.class).info("test info before stop"); // logs, ok
 loggerContext.stop();
 LoggerFactory.getLogger(AbstractTest.class).info("test info between stop and start"); // doesn't log, ok
 loggerContext.start();
 LoggerFactory.getLogger(AbstractTest.class).info("test info after start"); // doesn't log, why???
-----------

Is it normal or not?

Thanks in advance for your anwser.

Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-dev/attachments/20130221/66ba6348/attachment.html>


More information about the logback-dev mailing list