Package ch.qos.logback.classic.util

Examples of ch.qos.logback.classic.util.ContextInitializer


   * Package access for testing purposes.
   */
  void init() {
    try {
      try {
        new ContextInitializer(defaultLoggerContext).autoConfig();
      } catch (JoranException je) {
        Util.reportFailure("Failed to auto configure default logger context",
            je);
      }
      StatusPrinter.printInCaseOfErrorsOrWarnings(defaultLoggerContext);
View Full Code Here


    }
    return false;
  }

  public void reloadDefaultConfiguration() throws JoranException {
    ContextInitializer ci = new ContextInitializer(loggerContext);
    URL url = ci.findURLOfDefaultConfigurationFile(true);
    reloadByURL(url);
  }
View Full Code Here

        URL url = findConfigFileURL(ctx, loggerContext);
        if (url != null) {
          configureLoggerContextByURL(loggerContext, url);
        } else {
          try {
            new ContextInitializer(loggerContext).autoConfig();
          } catch (JoranException je) {
          }
        }
        StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
      }
View Full Code Here

   * Package access for testing purposes.
   */
  void init() {
    try {
      try {
        new ContextInitializer(defaultLoggerContext).autoConfig();
      } catch (JoranException je) {
        Util.reportFailure("Failed to auto configure default logger context",
            je);
      }
      StatusPrinter.printInCaseOfErrorsOrWarnings(defaultLoggerContext);
View Full Code Here

      password = args[3];
    }

    LoggerContext loggerContext = (LoggerContext) LoggerFactory
        .getILoggerFactory();
    new ContextInitializer(loggerContext).autoConfig();

    new JMSTopicSink(tcfBindingName, topicBindingName, username, password);

    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    // Loop until the word "exit" is typed
View Full Code Here

  public void reload() {
    LoggerContext lc = (LoggerContext) context;
    addInfo("Shutting down context: " + lc.getName());
    lc.shutdownAndReset();
    try {
      new ContextInitializer(lc).autoConfig();
      addInfo("Context: " + lc.getName() + " reloaded.");
    } catch(JoranException je) {
      addError("Reloading of context: " + lc.getName() + " failed.", je);
    }
  }
View Full Code Here

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

      password = args[3];
    }

    LoggerContext loggerContext = (LoggerContext) LoggerFactory
        .getILoggerFactory();
    new ContextInitializer(loggerContext).autoConfig();

    new JMSQueueSink(qcfBindingName, queueBindingName, username, password);

    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    // Loop until the word "exit" is typed
View Full Code Here

    try {
      // let's configure a default context
      LoggerContext defaultLoggerContext = new LoggerContext();
      defaultLoggerContext.setName("default");
      try {
        new ContextInitializer(defaultLoggerContext).autoConfig();
      } catch (JoranException je) {
        // TODO test me
        Util.reportFailure("Failed to auto configure default logger context",
            je);
      }
View Full Code Here

            JNDI_CONFIGURATION_RESOURCE);
        if (configFilePath != null) {
          configureLoggerContextByResource(loggerContext, configFilePath);
        } else {
          try {
            new ContextInitializer(loggerContext).autoConfig();
          } catch(JoranException je) {
            StatusPrinter.print(loggerContext);
          }
        }
      }
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.util.ContextInitializer

Copyright © 2018 www.massapicom. 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.