LoggerContext.close() is almost identical to
LoggerContext.reset(). Here is the code:

class LoggerContext ... {

  public void stop() {
    reset();
    fireOnStop();
    resetAllListeners();
    started = false;
  }
}

I don't think calling reset or close should make a difference. You want to release and close appenders which reset() does. Could you post your configuration file?

On 16.04.2013 16:59, Roxolid wrote:
Hi Ceki,

well, half-true in my case... I have that code in my
contextDestroyed(..) method, however, for whatever reason I have
lc.reset() instead of lc.stop there... Will change and test that once
I'm back to my dev machine. I will let you know then.

Thank you for your help.

Regards,
rox



On Tue, Apr 16, 2013 at 4:01 PM, ceki <[email protected] <mailto:[email protected]>>
wrote:

    Hi Rox,

    Are you stopping logback when your application is stopped (and then
    started)? The conextDestroyed method of
    javax.servlet.__ServletContextListener is a good place for invoking
    such code:

    import javax.servlet.__ServletContextListener;
    import javax.servlet.__ServletContextEvent;
    import org.slf4j.LoggerFactory;
    import ch.qos.logback.classic.__LoggerContext;

    public class MyServletContextListener implements
                                           ServletContextListener {

       public void contextInitialized(__ServletContextEvent sce) {
       }

       public void contextDestroyed(__ServletContextEvent sce)  {
         LoggerContext lc =
                   (LoggerContext) LoggerFactory.__getILoggerFactory();
         lc.stop();
    }

    Please let us know if stopping logback as described above helps.


    On 16.04.2013 15:06, Roxolid wrote:

        Hi all,

        I have a trouble with logback configuration under WebLogic 12c. My
        application is using RollingFile Appender with
        TimeBasedRollingPolicy
        and the problem is it stops logging every time I stop and then
        start the
        application through WebLogic Console. However, the logging is
        back when
        a rollover occurs - in the new file logging continues...

        Has anyone faced such behavior (and knows the solution)?

        Thank you in advance.

        Regards,

        rox




--
Ceki
65% of statistics are made up on the spot
_______________________________________________
Logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user

Reply via email to