Examples of detachAndStopAllAppenders()


Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

        gelf.setHostName(hostName);

        final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);

        if (cleanRootLogger) {
            root.detachAndStopAllAppenders();
        }

        root.addAppender(gelf.build(root.getLoggerContext(), name, null));
    }
}
View Full Code Here

Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

    public static void bootstrap(Level level) {
        hijackJDKLogging();

        final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
        root.detachAndStopAllAppenders();

        final DropwizardLayout formatter = new DropwizardLayout(root.getLoggerContext(),
                                                        TimeZone.getDefault());
        formatter.start();
View Full Code Here

Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

        boolean debugGrapht = options.getBoolean("debug_grapht");
        File logFile = options.get("log_file");

        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        Logger root = context.getLogger(Logger.ROOT_LOGGER_NAME);
        root.detachAndStopAllAppenders();

        ConsoleAppender<ILoggingEvent> console = new ConsoleAppender<ILoggingEvent>();
        console.setContext(context);
        console.setTarget("System.err");
        console.setWithJansi(true);
View Full Code Here

Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

  }

  public Logger prepareRootLogger(LoggerContext context) {
    Logger rootLogger = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);

    rootLogger.detachAndStopAllAppenders();

    return rootLogger;
  }

  public Logger configureRootLogger(String rootLogLevel) {
View Full Code Here

Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

    LoggerContext context = new LoggerContext();

    baseLogging.prepareRootLogger(context);

    Logger taskLogger = context.getLogger(taskId);
    taskLogger.detachAndStopAllAppenders();

    taskLogger.addAppender(baseLogging.buildFileAppender(context, baseLogging.getRootLogPath()));
    taskLogger.addAppender(baseLogging.buildFileAppender(context, taskLogFile));

    context.start();
View Full Code Here

Examples of ch.qos.logback.classic.Logger.detachAndStopAllAppenders()

   * @param maxHistory
   */
  private void doInitializer(String file, String level, int maxHistory) {
    LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
    Logger rootLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
    rootLogger.detachAndStopAllAppenders();

    // appender
    RollingFileAppender<ILoggingEvent> fileAppender = new RollingFileAppender<ILoggingEvent>();
    fileAppender.setContext(loggerContext);
    fileAppender.setName("application");
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.