From a96c95487b97c7b3cf3161574f85163402bf584a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Thu, 17 Nov 2016 11:41:25 +0100 Subject: [PATCH] SONAR-8332 fix missing display of HTTP request ID in Web logs --- .../main/java/org/sonar/server/app/WebServerProcessLogging.java | 2 +- .../java/org/sonar/server/app/WebServerProcessLoggingTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java index 325a453d2cb..42c6bbfd19c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java @@ -33,7 +33,7 @@ import static org.sonar.process.LogbackHelper.LogDomain; public class WebServerProcessLogging extends ServerProcessLogging { public WebServerProcessLogging() { - super(ProcessId.WEB_SERVER, "%X{UID}"); + super(ProcessId.WEB_SERVER, "%X{ID}"); } @Override diff --git a/server/sonar-server/src/test/java/org/sonar/server/app/WebServerProcessLoggingTest.java b/server/sonar-server/src/test/java/org/sonar/server/app/WebServerProcessLoggingTest.java index e3411dcd6f7..4cf2d80ea33 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/app/WebServerProcessLoggingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/app/WebServerProcessLoggingTest.java @@ -85,7 +85,7 @@ public class WebServerProcessLoggingTest { assertThat(fileAppender.getFile()).isEqualTo(new File(logDir, "web.log").getAbsolutePath()); assertThat(fileAppender.getEncoder()).isInstanceOf(PatternLayoutEncoder.class); PatternLayoutEncoder encoder = (PatternLayoutEncoder) fileAppender.getEncoder(); - assertThat(encoder.getPattern()).isEqualTo("%d{yyyy.MM.dd HH:mm:ss} %-5level web[%X{UID}][%logger{20}] %msg%n"); + assertThat(encoder.getPattern()).isEqualTo("%d{yyyy.MM.dd HH:mm:ss} %-5level web[%X{ID}][%logger{20}] %msg%n"); } @Test -- 2.39.5