Package ch.qos.logback.classic.joran

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


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

    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    lc.reset();
    configurator.doConfigure(ClassicTestConstants.JORAN_INPUT_PREFIX
        + "syslog_LBCLASSIC_50.xml");

    org.slf4j.Logger logger = LoggerFactory.getLogger(this.getClass());
    logger.info("hello");
  }
View Full Code Here


    final JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(context);
    context.putProperty("LOG_LEVEL", level);
    context.putProperty("LOG_DIRECTORY", logDirectory.getAbsolutePath());
    try {
      configurator.doConfigure(getClass().getResource("/logback-agent.xml"));
    } catch (JoranException e) {
      LOGGER.error("Error while configuring logger", e);
    }
  }
View Full Code Here

        } else {
          context.putProperty("SUFFIX", "");
          context.putProperty("LOG_DIRECTORY", home.getGlobalLogFile().getAbsolutePath());
        }
      }
      configurator.doConfigure(logbackConf);
    } catch (JoranException e) {
      CoreLogger.LOGGER.error(e.getMessage(), e);
    } catch (IOException e) {
      CoreLogger.LOGGER.error(e.getMessage(), e);
    }
View Full Code Here

  private void configure(String file) throws JoranException {
    JoranConfigurator jc = new JoranConfigurator();
    jc.setContext(loggerContext);
    loggerContext.putProperty("port", "" + port);
    jc.doConfigure(file);
  }

  @Test
  public void testCustomEvaluator() throws Exception {
    configure(ClassicTestConstants.JORAN_INPUT_PREFIX
View Full Code Here

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

    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    lc.reset();
    configurator.doConfigure("/home/ceki/lbcore211.xml");

    Logger l = lc.getLogger("file.logger");
    StatusPrinter.print(lc);
    for (int i = 0; i < 10; i++) {
      l.info("hello " + i);
View Full Code Here

    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    context.reset();
    JoranConfigurator joranConfigurator = new JoranConfigurator();
    joranConfigurator.setContext(context);
    joranConfigurator.doConfigure("src/test/java/ch/qos/logback/classic/issue/DarioCampagna/logback-marker.xml");
    IMessageConveyor mc = new MessageConveyor(Locale.getDefault());
    LocLoggerFactory llFactory_default = new LocLoggerFactory(mc);
    LocLogger locLogger = llFactory_default.getLocLogger("defaultLocLogger");
    Marker alwaysMarker = MarkerFactory.getMarker("ALWAYS");
    locLogger.info(alwaysMarker, "This will always appear.");
View Full Code Here

  }

  public void doTest(String configFile) throws JoranException, SQLException {
    JoranConfigurator configurator = new JoranConfigurator();
    configurator.setContext(lc);
    configurator.doConfigure(configFile);

    Logger logger = lc.getLogger(DBAppenderIntegrationTest.class);

    // the key userid is used in SiftingAppender test
    // suffix with diff to avoid collision
View Full Code Here

   static void init(String file) throws JoranException {
     LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
     JoranConfigurator jc = new JoranConfigurator();
     jc.setContext(loggerContext);
     loggerContext.reset();
     jc.doConfigure(file);
   }
}
View Full Code Here

  }

  void configure(String file) throws JoranException {
    JoranConfigurator jc = new JoranConfigurator();
    jc.setContext(lc);
    jc.doConfigure(file);
  }

  @Test
  public void testConversionRuleSupportInHtmlLayout() throws JoranException {
    configure(ClassicTestConstants.JORAN_INPUT_PREFIX
View Full Code Here

   static void init(String file) throws JoranException {
     LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
     JoranConfigurator jc = new JoranConfigurator();
     jc.setContext(loggerContext);
     loggerContext.reset();
     jc.doConfigure(file);
   }
}
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.