Log also thread name in the httpd_log

Having thread name in the httpd_log makes it easier to match entries from the
error_log and httpd_log (note that error_log entries already contain the
thread name). With the thread name included in each log entry in the httpd_log
we have more data to match an error to a request than just the timestamp.

Even with the request trace feature [1] this is still useful as we can do more
analysis before we ask the user to reproduce an error using the request trace.

[1] https://gerrit-review.googlesource.com/Documentation/user-request-tracing.html

Change-Id: I60f0fde1c2708bdc56e6ab458d66abee1b9c59aa
This commit is contained in:
Saša Živkov
2019-12-12 17:12:16 +01:00
committed by Saša Živkov
parent ada0e04d66
commit 4e0a432f8e
2 changed files with 6 additions and 1 deletions

View File

@@ -72,7 +72,7 @@ class HttpLog extends AbstractLifeCycle implements RequestLog {
TimeUtil.nowMs(), // when
Level.INFO, // level
"", // message text
"HTTPD", // thread name
Thread.currentThread().getName(), // thread name
null, // exception information
null, // current NDC string
null, // caller location

View File

@@ -40,6 +40,11 @@ public final class HttpLogLayout extends Layout {
opt(buf, event, HttpLog.P_HOST);
buf.append(' ');
buf.append('[');
buf.append(event.getThreadName());
buf.append(']');
buf.append(' ');
buf.append('-'); // identd on client system (never requested)