Search in sources :

Example 1 with LevelFilter

use of ch.qos.logback.classic.filter.LevelFilter in project sonarlint-core by SonarSource.

the class SonarLintLogging method init.

private static void init() {
    ConsoleAppender<ILoggingEvent> defaultAppender = new ConsoleAppender<>();
    defaultAppender.setContext((LoggerContext) LoggerFactory.getILoggerFactory());
    defaultAppender.setName(DEFAULT_APPENDER_NAME);
    LevelFilter levelFilter = new LevelFilter();
    levelFilter.setLevel(Level.ERROR);
    defaultAppender.addFilter(levelFilter);
    // if output is not set for thread, keep default behavior (configured to stdout)
    setCustomRootAppender(defaultAppender);
}
Also used : ConsoleAppender(ch.qos.logback.core.ConsoleAppender) LevelFilter(ch.qos.logback.classic.filter.LevelFilter) ILoggingEvent(ch.qos.logback.classic.spi.ILoggingEvent)

Aggregations

LevelFilter (ch.qos.logback.classic.filter.LevelFilter)1 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)1 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)1