Package org.apache.pekko.actor
Interface DiagnosticActorLogging
- All Superinterfaces:
Actor
Scala API: Mix in DiagnosticActorLogging into your Actor to easily obtain a reference to a logger with MDC support,
which is available under the name "log".
In the example bellow "the one who knocks" will be available under the key "iam" for using it in the logback pattern.
class MyActor extends Actor with DiagnosticActorLogging {
override def mdc(currentMessage: Any): MDC = {
Map("iam", "the one who knocks")
}
def receive = {
case "pigdog" => log.info("We've got yet another pigdog on our hands")
}
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$ -
Method Summary
Modifier and TypeMethodDescriptionvoidaroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> receive, Object msg) INTERNAL API.log()voidvoidsuper$aroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> receive, Object msg) Methods inherited from interface org.apache.pekko.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, postStop, preRestart, preStart, receive, self, sender, supervisorStrategy, unhandled
-
Method Details
-
aroundReceive
Description copied from interface:ActorINTERNAL API.Can be overridden to intercept calls to this actor's current behavior.
- Specified by:
aroundReceivein interfaceActor- Parameters:
receive- current behavior.msg- current message.
-
log
DiagnosticLoggingAdapter log() -
mdc
-
org$apache$pekko$actor$DiagnosticActorLogging$_setter_$log_$eq
-
super$aroundReceive
-