aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2021-12-13 17:24:23 +0100
committersonartech <sonartech@sonarsource.com>2021-12-17 12:06:46 +0000
commit1133286583c24e93288a6d896cc069597ae541ce (patch)
tree1c56e4a977fff19663a522d27cbd6e08a4918246 /server
parent57c561eebf9473454138ceb3c412be24db94ece4 (diff)
downloadsonarqube-1133286583c24e93288a6d896cc069597ae541ce.tar.gz
sonarqube-1133286583c24e93288a6d896cc069597ae541ce.zip
SONAR-15827 Fix SSF-219
Diffstat (limited to 'server')
-rw-r--r--server/sonar-main/build.gradle1
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java12
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java4
3 files changed, 4 insertions, 13 deletions
diff --git a/server/sonar-main/build.gradle b/server/sonar-main/build.gradle
index 7e888f1298e..4f6590b8518 100644
--- a/server/sonar-main/build.gradle
+++ b/server/sonar-main/build.gradle
@@ -19,7 +19,6 @@ dependencies {
compile 'org.apache.logging.log4j:log4j-api'
compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client'
compile 'org.elasticsearch:elasticsearch'
- compile 'org.elasticsearch:elasticsearch-core'
compile 'org.slf4j:slf4j-api'
compile 'org.yaml:snakeyaml'
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java b/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
index 89a2e99aae0..09ac20a2199 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
@@ -71,17 +71,6 @@ public class EsJvmOptions extends JvmOptions<EsJvmOptions> {
// specify an alternative path for JVM fatal error logs (ES 6.6.1 default is "logs/hs_err_pid%p.log")
res.put("-XX:ErrorFile=", "../logs/es_hs_err_pid%p.log");
- // JDK 8 GC logging (by default ES 6.6.1 enables them, we don't want to do that in SQ, no one will analyze them anyway)
- // res.put("8:-XX:+PrintGCDetails", "");
- // res.put("8:-XX:+PrintGCDateStamps", "");
- // res.put("8:-XX:+PrintTenuringDistribution", "");
- // res.put("8:-XX:+PrintGCApplicationStoppedTime", "");
- // res.put("8:-Xloggc:logs/gc.log", "");
- // res.put("8:-XX:+UseGCLogFileRotation", "");
- // res.put("8:-XX:NumberOfGCLogFiles", "32");
- // res.put("8:-XX:GCLogFileSize", "64m");
- // JDK 9+ GC logging
- // res.put("9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m", "");
}
/**
@@ -121,6 +110,7 @@ public class EsJvmOptions extends JvmOptions<EsJvmOptions> {
// log4j 2
res.put("-Dlog4j.shutdownHookEnabled=", "false");
res.put("-Dlog4j2.disable.jmx=", "true");
+ res.put("-Dlog4j2.formatMsgNoLookups=", "true");
/*
* Due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise time/date
* parsing will break in an incompatible way for some date patterns and locales.
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
index b2d772c39aa..5740f761456 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
@@ -46,7 +46,7 @@ public class EsJvmOptionsTest {
EsJvmOptions underTest = new EsJvmOptions(new Props(properties), tmpDir);
assertThat(underTest.getAll())
- .containsExactly(
+ .containsExactlyInAnyOrder(
"-XX:+UseG1GC",
"-Djava.io.tmpdir=" + tmpDir.getAbsolutePath(),
"-XX:ErrorFile=../logs/es_hs_err_pid%p.log",
@@ -64,6 +64,7 @@ public class EsJvmOptionsTest {
"-Dio.netty.allocator.numDirectArenas=0",
"-Dlog4j.shutdownHookEnabled=false",
"-Dlog4j2.disable.jmx=true",
+ "-Dlog4j2.formatMsgNoLookups=true",
"-Djava.locale.providers=COMPAT",
"-Dcom.redhat.fips=false",
"-Des.enforce.bootstrap.checks=true");
@@ -146,6 +147,7 @@ public class EsJvmOptionsTest {
"-Dio.netty.allocator.numDirectArenas=0\n" +
"-Dlog4j.shutdownHookEnabled=false\n" +
"-Dlog4j2.disable.jmx=true\n" +
+ "-Dlog4j2.formatMsgNoLookups=true\n" +
"-Djava.locale.providers=COMPAT\n" +
"-Dcom.redhat.fips=false\n" +
"-Des.enforce.bootstrap.checks=true\n" +