Examples of JoranConfigurator


Examples of ch.qos.logback.access.joran.JoranConfigurator

    }
    File configFile = new File(filename);
    if (configFile.exists()) {
      try {
        JoranConfigurator jc = new JoranConfigurator();
        jc.setContext(this);
        jc.doConfigure(filename);
      } catch (JoranException e) {
        StatusPrinter.print(getStatusManager());
      }
    } else {
      getStatusManager().add(
View Full Code Here

Examples of ch.qos.logback.access.joran.JoranConfigurator

    }
    try {
      File configFile = new File(filename);
      if (configFile.exists()) {
        JoranConfigurator jc = new JoranConfigurator();
        jc.setContext(this);
        jc.doConfigure(filename);

      } else {
        getStatusManager().add(
            new ErrorStatus("[" + filename + "] does not exist", this));
      }
View Full Code Here

Examples of ch.qos.logback.access.joran.JoranConfigurator

    started = true;
  }

  private void runJoranOnFile(File configFile) {
    try {
      JoranConfigurator jc = new JoranConfigurator();
      jc.setContext(this);
      jc.doConfigure(configFile);
      if (getName() == null) {
        setName("LogbackRequestLog");
      }
    } catch (JoranException e) {
      // errors have been registered as status messages
View Full Code Here

Examples of ch.qos.logback.audit.client.joran.JoranConfigurator

  public static void configureByResource(Auditor auditor, URL url)
      throws AuditException {
    if (url == null) {
      throw new IllegalArgumentException("URL argument cannot be null");
    }
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(auditor);

    try {
      configurator.doConfigure(url);
    } catch (JoranException e) {
      throw new AuditException("Configuration failure in " + url, e);
    }

  }
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

        getStatusManager().add(statusListener);
        addInfo("Resetting context: " + getLoggerContext().getName());
        resetContext(statusListener);

        StatusUtil statusUtil = new StatusUtil(getLoggerContext());
        JoranConfigurator configurator = createConfigurator();
        final List<SaxEvent> eventList = configurator.recallSafeConfiguration();
        final long threshold = System.currentTimeMillis();
        boolean success = false;
        try {
            cb.perform(configurator);
            if (statusUtil.hasXMLParsingErrors(threshold)) {
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

        if (logbackConfigLocation == null) {
          BasicConfigurator.configureDefaultContext();
          LOG.info("No context-specific configuration file found, will use Logback's default configuration");
        } else {
          LOG.debug("Found logback configuration file at {}", logbackConfigLocation);
          JoranConfigurator configurator = new JoranConfigurator();
          configurator.setContext(lc);
          // the context was probably already configured by default configuration rules
          lc.reset();
          try {
            configurator.doConfigure(logbackConfigLocation);
          } catch (JoranException je) {
            // StatusPrinter will handle this
          }

        }
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

        logger.debug("This is a test with a really long ending: " + longMessage);
    }

    private void addTypedFieldToAppender() throws JoranException {
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        JoranConfigurator joranConfigurator = new JoranConfigurator();
        joranConfigurator.setContext(lc);
        joranConfigurator.doConfigure(Resources.getResource("typedFields.xml"));
    }
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

        joranConfigurator.doConfigure(Resources.getResource("typedFields.xml"));
    }

    private void addStaticFieldToAppender() throws JoranException {
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        JoranConfigurator joranConfigurator = new JoranConfigurator();
        joranConfigurator.setContext(lc);
        joranConfigurator.doConfigure(Resources.getResource("staticAdditionalFields.xml"));
    }
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

        context.reset();

        try {

            // Initialize logback
            JoranConfigurator configurator = new JoranConfigurator();
            configurator.setContext(context);
            configurator.doConfigure(logbackConfiguration);

            // Dump any errors that occur during logback init
            StatusPrinter.printInCaseOfErrorsOrWarnings(context);

        }
View Full Code Here

Examples of ch.qos.logback.classic.joran.JoranConfigurator

    }
  }

  static public void configureLC(LoggerContext lc, String configFile)
      throws JoranException {
    JoranConfigurator configurator = new JoranConfigurator();
    lc.reset();
    configurator.setContext(lc);
    configurator.doConfigure(configFile);
  }
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.