akka.event.slf4j
Class Slf4jLogger
java.lang.Object
akka.event.slf4j.Slf4jLogger
- All Implemented Interfaces:
- Actor, SLF4JLogging
public class Slf4jLogger
- extends java.lang.Object
- implements Actor, SLF4JLogging
SLF4J logger.
The thread in which the logging was performed is captured in
Mapped Diagnostic Context (MDC) with attribute name "sourceThread".
Method Summary |
protected java.lang.String |
formatTimestamp(long timestamp)
Override this method to provide a differently formatted timestamp |
java.lang.String |
mdcAkkaSourceAttributeName()
|
java.lang.String |
mdcAkkaTimestamp()
|
java.lang.String |
mdcThreadAttributeName()
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function
with the actor logic. |
void |
withMdc(java.lang.String logSource,
Logging.LogEvent logEvent,
scala.Function0<scala.runtime.BoxedUnit> logStatement)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface akka.actor.Actor |
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, postStop, preRestart, preStart, self, sender, supervisorStrategy, unhandled |
Slf4jLogger
public Slf4jLogger()
mdcThreadAttributeName
public java.lang.String mdcThreadAttributeName()
mdcAkkaSourceAttributeName
public java.lang.String mdcAkkaSourceAttributeName()
mdcAkkaTimestamp
public java.lang.String mdcAkkaTimestamp()
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
- Description copied from interface:
Actor
- This defines the initial actor behavior, it must return a partial function
with the actor logic.
- Specified by:
receive
in interface Actor
- Returns:
- (undocumented)
withMdc
public final void withMdc(java.lang.String logSource,
Logging.LogEvent logEvent,
scala.Function0<scala.runtime.BoxedUnit> logStatement)
formatTimestamp
protected java.lang.String formatTimestamp(long timestamp)
- Override this method to provide a differently formatted timestamp
- Parameters:
timestamp
- a "currentTimeMillis"-obtained timestamp
- Returns:
- the given timestamp as a UTC String