From 4a0af974b74e68159b9304752b5832487bf58cf8 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Fri, 28 Jul 2017 10:52:45 +0200 Subject: SONAR-8798 reduce Elasticsearch log level to "WARN" for unit tests --- server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/sonar-server') diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java b/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java index addb74de18a..5a0bf45b3f0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java @@ -44,6 +44,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.MetaData; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; @@ -81,6 +82,10 @@ public class EsTester extends ExternalResource { System.setProperty("es.log4j.shutdownEnabled", "false"); System.setProperty("log4j2.disable.jmx", "true"); System.setProperty("log4j.skipJansi", "true"); // jython has this crazy shaded Jansi version that log4j2 tries to load + + if (!Strings.hasLength(System.getProperty("tests.es.logger.level"))) { + System.setProperty("tests.es.logger.level", "WARN"); + } } private static final Set NO_TEMPLATES_SURVIVING_WIPE = Collections.emptySet(); -- cgit v1.2.3