Examples of shutdownAndReset()


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

  }

  public void reload() {
    LoggerContext lc = (LoggerContext) context;
    addInfo("Shutting down context: " + lc.getName());
    lc.shutdownAndReset();
    ContextInitializer.autoConfig(lc, lc.getClass().getClassLoader());
    addInfo("Context: " + lc.getName() + " reloaded.");
  }

  public void reload(String fileName) throws JoranException {
View Full Code Here

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

  }

  public void reload(String fileName) throws JoranException {
    LoggerContext lc = (LoggerContext) context;
    addInfo("Shutting down context: " + lc.getName());
    lc.shutdownAndReset();
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    configurator.doConfigure(fileName);
    addInfo("Context: " + lc.getName() + " reloaded.");
  }
View Full Code Here

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

  }

  public void reload(URL url) throws JoranException {
    LoggerContext lc = (LoggerContext) context;
    addInfo("Shutting down context: " + lc.getName());
    lc.shutdownAndReset();
    ContextInitializer.configureByResource(lc, url);
    addInfo("Context: " + lc.getName() + " reloaded.");
  }

  public void setLoggerLevel(String loggerName, String levelStr) {
View Full Code Here

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

      ContextSelector selector = StaticLoggerBinder.SINGLETON.getContextSelector();
      LoggerContext context = selector.detachLoggerContext(loggerContextName);
      if (context != null) {
        Logger logger = context.getLogger(LoggerContext.ROOT_NAME);
        logger.warn("Shutting down context " + loggerContextName);
        context.shutdownAndReset();
      } else {
        System.out.println("No context named " + loggerContextName + " was found.");
      }
    }
  }
View Full Code Here

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

    if (configFile.endsWith(".xml")) {
      try {
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        JoranConfigurator configurator = new JoranConfigurator();
        configurator.setContext(lc);
        lc.shutdownAndReset();
        configurator.doConfigure(args[0]);
      } catch (JoranException je) {
        je.printStackTrace();
      }
    }
View Full Code Here

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

  static void programmaticConfiguration() {
    // Configure logback
    LoggerContext loggerContext = (LoggerContext) LoggerFactory
        .getILoggerFactory();
    loggerContext.shutdownAndReset();
    PatternLayout layout = new PatternLayout();
    layout.setContext(loggerContext);
    layout.setPattern("%X{first} %X{last} - %m%n");
    layout.start();
    ConsoleAppender<LoggingEvent> appender = new ConsoleAppender<LoggingEvent>();
View Full Code Here

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

  static void configureViaXML_File() {
    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    try {
      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      lc.shutdownAndReset();
      URL url = Loader.getResourceBySelfClassLoader("chapter7/simpleMDC.xml");
      configurator.doConfigure(url);
    } catch (JoranException je) {
      StatusPrinter.print(lc);
    }
View Full Code Here

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

    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();

    try {
      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      lc.shutdownAndReset();
      configurator.doConfigure(args[0]);
    } catch (JoranException je) {
      je.printStackTrace();
    }
   
View Full Code Here

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

    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();

    try {
      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      lc.shutdownAndReset();
      configurator.doConfigure(args[0]);
    } catch (JoranException je) {
      je.printStackTrace();
    }
    // After we've called Joran, let's print information about the
View Full Code Here

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

    int runLength = Integer.parseInt(args[0]);
    String configFile = args[1];

    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    JoranConfigurator configurator = new JoranConfigurator();
    lc.shutdownAndReset();
    configurator.setContext(lc);
    configurator.doConfigure(configFile);
    StatusPrinter.printIfErrorsOccured(lc);
   
    Logger logger = LoggerFactory.getLogger(EMail.class);
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.