...and correcting myself a bit as i figured that only ContextInitializer autoConfig() was required after
LoggerContext stop() & start(), as the stop() call already do reset().

It's a really nice library to work with by the way, finely extendable.

Mathieu

 

----- Message d'origine -----

De : Mathieu Stempell

Envoyés : 21.02.13 15:15

À : logback developers list

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

 
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@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