+slf #16630 Add the actor system name to the Slf4jLogger context

This commit is contained in:
Nikita Melkozerov 2015-01-12 21:03:42 +05:00
parent c56d670c03
commit e49ea9b5e4
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`_.