Package ch.qos.logback.classic.joran

Examples of ch.qos.logback.classic.joran.JoranConfigurator.doConfigure()


        // 初始化Logback
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        JoranConfigurator configurator = new JoranConfigurator();
        configurator.setContext(lc);
        lc.reset();
        configurator.doConfigure(rocketmqHome + "/conf/logback_tools.xml");
    }


    private static String[] parseSubArgs(String[] args) {
        if (args.length > 1) {
View Full Code Here


  protected void configure(final ServletContext sc, final URL location, final LoggerContext lc) {
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    lc.stop();
    try {
      configurator.doConfigure(location);
    } catch (JoranException e) {
      sc.log("Failed to configure logback.", e);
    }
    StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
  }
View Full Code Here

    }

    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    configurator.doConfigure(configFile);

    File dir = new File(dirStr);
    if (!dir.isDirectory()) {
      usage("[" + dirStr + "] is not a directory.");
    }
View Full Code Here

        LoggerContext lc = new LoggerContext();
        hierarchyMap.put(inetAddress, lc);

        JoranConfigurator configurator = new JoranConfigurator();
        configurator.setContext(lc);
        configurator.doConfigure(configFile);

        return lc;
      } else {
        logger.warn("Could not find config file [" + configFile + "].");
        return genericHierarchy();
View Full Code Here

      File f = new File(dir, GENERIC + CONFIG_FILE_EXT);
      if (f.exists()) {
        genericHierarchy = new LoggerContext();
        JoranConfigurator configurator = new JoranConfigurator();
        configurator.setContext(genericHierarchy);
        configurator.doConfigure(f.getAbsolutePath());

      } else {
        logger.warn("Could not find config file [" + f
            + "]. Will use the default hierarchy.");
        genericHierarchy = new LoggerContext();
View Full Code Here

    if (configFile.endsWith(".xml")) {
      LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      configurator.doConfigure(configFile);
    }
  }
}
View Full Code Here

      JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(lc);
      // the context was probably already configured by
      // default configuration rules
      lc.reset();
      configurator.doConfigure(file);

      // Save the filepath after loading the file
      filepath = file.getAbsolutePath();
    } catch (JoranException je) {}
View Full Code Here

      // restore persisted setting so pax-logging can reload
      context.putObject(PAX_BUNDLE_CONTEXT_KEY, bundleContext);

      context.getStatusManager().clear();
      installNonResetResistantListeners();
      configurator.doConfigure(file);
    }
    catch (JoranException e) {
      e.printStackTrace();
    }
View Full Code Here

            JoranConfigurator configurator = new JoranConfigurator();
            configurator.setContext(loggerContext);
            // Call context.reset() to clear any previous configuration, e.g. default
            // configuration. For multi-step configuration, omit calling context.reset().
            loggerContext.reset();
            configurator.doConfigure(logfile);
        } catch (JoranException je) {
            // StatusPrinter will handle this
        }
        StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
    }
View Full Code Here

          if (url != null) {
            try {
              JoranConfigurator configurator = new JoranConfigurator();
              loggerContext.reset();
              configurator.setContext(loggerContext);
              configurator.doConfigure(url);
            } catch (JoranException e) {
              StatusPrinter.print(loggerContext);
            }
          } else {
            try {
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.