aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-11-17 15:57:24 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-11-17 17:59:44 +0100
commit8f706d3cafcb4e676a5a5d682e3ed78518a8a387 (patch)
treec2a320d1d40368a364b18fbd6691ce464e3b1d59 /server
parenta96c95487b97c7b3cf3161574f85163402bf584a (diff)
downloadsonarqube-8f706d3cafcb4e676a5a5d682e3ed78518a8a387.tar.gz
sonarqube-8f706d3cafcb4e676a5a5d682e3ed78518a8a387.zip
SONAR-8332 change default access log pattern to include SQ's HTTP request ID
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/app/TomcatAccessLog.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatAccessLog.java b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatAccessLog.java
index 54e893240bd..18792c1676f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatAccessLog.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatAccessLog.java
@@ -31,8 +31,9 @@ import org.sonar.process.Props;
class TomcatAccessLog {
- public static final String PROPERTY_ENABLE = "sonar.web.accessLogs.enable";
- public static final String PROPERTY_PATTERN = "sonar.web.accessLogs.pattern";
+ private static final String PROPERTY_ENABLE = "sonar.web.accessLogs.enable";
+ private static final String PROPERTY_PATTERN = "sonar.web.accessLogs.pattern";
+ private static final String DEFAULT_SQ_ACCESS_LOG_PATTERN = "%h %l %u [%t] \"%r\" %s %b \"%i{Referer}\" \"%i{User-Agent}\" \"%reqAttribute{ID}\"";
void configure(Tomcat tomcat, Props props) {
tomcat.setSilent(true);
@@ -48,7 +49,7 @@ class TomcatAccessLog {
FileAppender appender = policy.createAppender("ACCESS_LOG");
PatternLayoutEncoder fileEncoder = new PatternLayoutEncoder();
fileEncoder.setContext(valve);
- fileEncoder.setPattern(props.value(PROPERTY_PATTERN, "combined"));
+ fileEncoder.setPattern(props.value(PROPERTY_PATTERN, DEFAULT_SQ_ACCESS_LOG_PATTERN));
fileEncoder.start();
appender.setEncoder(fileEncoder);
appender.start();