#3080 - Including a timestamp in LogEvent and in the MDC

This commit is contained in:
Viktor Klang 2013-04-21 00:40:47 -07:00
parent 75c9d1d5ad
commit 7f84dbf448
7 changed files with 95 additions and 19 deletions

View file

@ -284,3 +284,16 @@ information is available in the MDC with attribute name ``akkaSource``::
For more details on what this attribute contains—also for non-actors—please see
`How to Log`_.
More accurate timestamps for log output in MDC
------------------------------------------------
Akka's logging is asynchronous which means that the timestamp of a log entry is taken from
when the underlying logger implementation is called, which can be surprising at first.
If you want to more accurately output the timestamp, use the MDC attribute ``akkaTimestamp``::
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%X{akkaTimestamp} %-5level %logger{36} %X{akkaSource} - %msg%n</pattern>
</encoder>
</appender>

View file

@ -322,3 +322,17 @@ information is available in the MDC with attribute name ``akkaSource``::
For more details on what this attribute contains—also for non-actors—please see
`How to Log`_.
More accurate timestamps for log output in MDC
------------------------------------------------
Akka's logging is asynchronous which means that the timestamp of a log entry is taken from
when the underlying logger implementation is called, which can be surprising at first.
If you want to more accurately output the timestamp, use the MDC attribute ``akkaTimestamp``::
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%X{akkaTimestamp} %-5level %logger{36} %X{akkaSource} - %msg%n</pattern>
</encoder>
</appender>