Package ch.qos.logback.classic

Examples of ch.qos.logback.classic.LoggerContext.stop()


    }

    @Override
    public void shutdown() {
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        lc.stop();
    }
}
View Full Code Here


      LoggerContext context = selector.detachLoggerContext(loggerContextName);
      if (context != null) {
        Logger logger = context.getLogger(LoggerContext.ROOT_NAME);
        logger.warn("Stopping logger context " + loggerContextName);
        // when the web-app is destroyed, its logger context should be stopped
        context.stop();
      } else {
        System.out.println("No context named " + loggerContextName + " was found.");
      }
    }
  }
View Full Code Here

      if (context != null) {
        Logger logger = context.getLogger(Logger.ROOT_LOGGER_NAME);
        logger.warn("Stopping logger context " + loggerContextName);
        selector.detachLoggerContext(loggerContextName);
        // when the web-app is destroyed, its logger context should be stopped
        context.stop();
      } else {
        System.out.println("No context named " + loggerContextName + " was found.");
      }
    }
  }
View Full Code Here

      LoggerContext context = selector.detachLoggerContext(loggerContextName);
      if (context != null) {
        Logger logger = context.getLogger(Logger.ROOT_LOGGER_NAME);
        logger.warn("Stopping logger context " + loggerContextName);
        // when the web-app is destroyed, its logger context should be stopped
        context.stop();
      } else {
        System.out.println("No context named " + loggerContextName + " was found.");
      }
    }
  }
View Full Code Here

    private void shutDownLogger() {
        ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
        if (loggerFactory instanceof LoggerContext) {
            log.info("Shutting down LoggerContext");
            LoggerContext context = (LoggerContext) loggerFactory;
            context.stop();
        }
    }

    private void deregisterDrivers() {
        Enumeration<Driver> drivers = DriverManager.getDrivers();
View Full Code Here

  @Override
  public void contextDestroyed(final ServletContextEvent sce) {
    ILoggerFactory ilc = LoggerFactory.getILoggerFactory();
    if (ilc instanceof LoggerContext) {
      LoggerContext lc = (LoggerContext) ilc;
      lc.stop();
    }
  }
}
View Full Code Here

    public void stop() {
        ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
        if (loggerFactory instanceof LoggerContext) {
            LoggerContext context = (LoggerContext) loggerFactory;
            context.stop();
        }
    }

    private void configureInstrumentation(Logger root, MetricRegistry metricRegistry) {
        final InstrumentedAppender appender = new InstrumentedAppender(metricRegistry);
View Full Code Here

    LOG.info("Attempting to flush logs and wait {} ...", JavaUtils.durationFromMillis(millisToWait));

    ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
    if (loggerFactory instanceof LoggerContext) {
      LoggerContext context = (LoggerContext) loggerFactory;
      context.stop();
    }

    try {
      Thread.sleep(millisToWait);
    } catch (Exception e) {
View Full Code Here

    StatusPrinter.print(lc);
    for (int i = 0; i < 10; i++) {
      l.info("hello " + i);
    }

    lc.stop();
  }
}
View Full Code Here

    }

    allMessagesReceivedLatch.await();

    assertEquals(runLen, listAppender.list.size());
    loggerContext.stop();
    simpleSocketServer.close();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.