Merge pull request #16649 from meln1k/wip-16630-add-actor-system-name-to-Slf4jLogger-context-meln1k

+slf #16630 Add the actor system name to the Slf4jLogger context
This commit is contained in:
Konrad Malawski 2015-01-16 10:34:09 +01:00
commit 9dae14e1a5
5 changed files with 34 additions and 3 deletions

View file

@ -305,7 +305,7 @@ the first case and ``LoggerFactory.getLogger(String s)`` in the second).
final LoggingAdapter log = Logging.getLogger(system.eventStream(), "my.string");
Logging Thread and Akka Source in MDC
Logging Thread, Akka Source and Actor System in MDC
-------------------------------------
Since the logging is done asynchronously the thread in which the logging was performed is captured in
@ -335,6 +335,15 @@ information is available in the MDC with attribute name ``akkaSource``::
</encoder>
</appender>
Finally, the actor system in which the logging was performed
is available in the MDC with attribute name ``sourceActorSystem``::
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{ISO8601} %-5level %logger{36} %X{sourceActorSystem} - %msg%n</pattern>
</encoder>
</appender>
For more details on what this attribute contains—also for non-actors—please see
`How to Log`_.

View file

@ -341,7 +341,7 @@ the first case and ``LoggerFactory.getLogger(s: String)`` in the second).
val log = Logging(system.eventStream, "my.nice.string")
Logging Thread and Akka Source in MDC
Logging Thread, Akka Source and Actor System in MDC
-------------------------------------
Since the logging is done asynchronously the thread in which the logging was performed is captured in
@ -371,6 +371,15 @@ information is available in the MDC with attribute name ``akkaSource``::
</encoder>
</appender>
Finally, the actor system in which the logging was performed
is available in the MDC with attribute name ``sourceActorSystem``::
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{ISO8601} %-5level %logger{36} %X{sourceActorSystem} - %msg%n</pattern>
</encoder>
</appender>
For more details on what this attribute contains—also for non-actors—please see
`How to Log`_.