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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user