Examples of shutdownAndReset()


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

public class ExitWoes1 {

  public static void main(String[] args) throws Exception {
    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    lc.shutdownAndReset(); // we want to override the default-config.
    WriterAppender<LoggingEvent> writerAppender = new WriterAppender<LoggingEvent>();
    writerAppender.setContext(lc);
    writerAppender.setLayout(new EchoLayout<LoggingEvent>());

    OutputStream os = new FileOutputStream("exitWoes1.log");
View Full Code Here

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

    try {
      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      // the context was probably already configured by default configuration
      // rules
      lc.shutdownAndReset();
      configurator.doConfigure(args[0]);
    } catch (JoranException je) {
      je.printStackTrace();
    }
    StatusPrinter.printIfErrorsOccured(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("mdcFilter.xml");
     
    } catch (JoranException je) {
      StatusPrinter.print(lc);
    }
View Full Code Here

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

  }

  public void reload() {
    LoggerContext lc = (LoggerContext) context;
    addInfo("Shutting down context: " + lc.getName());
    lc.shutdownAndReset();
    try {
      ContextInitializer.autoConfig(lc, lc.getClass().getClassLoader());
      addInfo("Context: " + lc.getName() + " reloaded.");
    } catch(JoranException je) {
      addError("Reloading of context: " + lc.getName() + " failed.", je);
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()

    //String configFile = "src/main/java/chapter4/db/append-toMySQL.xml";
    String configFile = "src/main/java/chapter4/db/append-toSQLServer.xml";

    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    JoranConfigurator configurator = new JoranConfigurator();
    lc.shutdownAndReset();
    configurator.setContext(lc);
    configurator.doConfigure(configFile);
    StatusPrinter.printIfErrorsOccured(lc);
   
    Logger logger = LoggerFactory.getLogger(Main.class);
View Full Code Here

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