Search in sources :

Example 6 with RootLoggerConfig

use of org.sonar.process.logging.RootLoggerConfig in project sonarqube by SonarSource.

the class EsLogging method createProperties.

public Properties createProperties(Props props, File logDir) {
    Log4JPropertiesBuilder log4JPropertiesBuilder = new Log4JPropertiesBuilder(props);
    RootLoggerConfig config = newRootLoggerConfigBuilder().setNodeNameField(getNodeNameWhenCluster(props)).setProcessId(ProcessId.ELASTICSEARCH).build();
    String logPattern = log4JPropertiesBuilder.buildLogPattern(config);
    return log4JPropertiesBuilder.internalLogLevel(Level.ERROR).rootLoggerConfig(config).logPattern(logPattern).enableAllLogsToConsole(isAllLogsToConsoleEnabled(props)).jsonOutput(isJsonOutput(props)).logDir(logDir).logLevelConfig(LogLevelConfig.newBuilder(log4JPropertiesBuilder.getRootLoggerName()).rootLevelFor(ProcessId.ELASTICSEARCH).immutableLevel("DEPRECATION", Level.ERROR).immutableLevel("org.elasticsearch.deprecation", Level.ERROR).immutableLevel("org.elasticsearch.client.RestClient", Level.ERROR).build()).build();
}
Also used : RootLoggerConfig(org.sonar.process.logging.RootLoggerConfig) Log4JPropertiesBuilder(org.sonar.process.logging.Log4JPropertiesBuilder)

Aggregations

RootLoggerConfig (org.sonar.process.logging.RootLoggerConfig)6 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)3 Logger (ch.qos.logback.classic.Logger)2 LoggerContext (ch.qos.logback.classic.LoggerContext)1 Log4JPropertiesBuilder (org.sonar.process.logging.Log4JPropertiesBuilder)1