log4JPropertiesBuilder.apply(
LogLevelConfig.newBuilder(log4JPropertiesBuilder.getRootLoggerName())
.rootLevelFor(ProcessId.ELASTICSEARCH)
+ // turn off ES type deprecation logging to not flood logs
+ .immutableLevel("DEPRECATION", Level.ERROR)
+ .immutableLevel("org.elasticsearch.deprecation", Level.ERROR)
+ .immutableLevel("org.elasticsearch.client.RestClient", Level.ERROR)
.build());
return log4JPropertiesBuilder.get();
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
- private EsLogging underTest = new EsLogging();
+ private final EsLogging underTest = new EsLogging();
@Test
public void createProperties_with_empty_props() throws IOException {
"appender.file_es.strategy.action.condition.nested_condition.type", "IfAccumulatedFileCount",
"appender.file_es.strategy.action.condition.nested_condition.exceeds", "7",
"rootLogger.level", "INFO",
- "rootLogger.appenderRef.file_es.ref", "file_es");
+ "rootLogger.appenderRef.file_es.ref", "file_es",
+ "loggers", "DEPRECATION,org.elasticsearch.client.RestClient,org.elasticsearch.deprecation",
+ "logger.org.elasticsearch.client.RestClient.name", "org.elasticsearch.client.RestClient",
+ "logger.org.elasticsearch.deprecation.level", "ERROR",
+ "logger.org.elasticsearch.deprecation.name", "org.elasticsearch.deprecation",
+ "logger.DEPRECATION.level", "ERROR",
+ "logger.DEPRECATION.name", "DEPRECATION",
+ "logger.org.elasticsearch.client.RestClient.level", "ERROR"
+
+ );
}
@Test
builder.immutableLevel("org.elasticsearch.http", Level.INFO);
// turn off ES type deprecation logging to not flood logs
+ builder.immutableLevel("DEPRECATION", Level.ERROR);
builder.immutableLevel("org.elasticsearch.deprecation", Level.ERROR);
builder.immutableLevel("org.elasticsearch.client.RestClient", Level.ERROR);