The Scala API has a decoder LoggingReceivebecause the partial function literal makes it inconvenient to express something that needs to be done in all cases (for example, this log).
In Java, you do not have this problem, because your method is onReceivealways called, and you can put the registration operator at the top to view all the messages received by the actor. As an added bonus, you decide at what level to register them :-)
akka.actor.debug.receive ( Scala), , ,
if (getContext().system().settings().AddLoggingReceive())
log.debug("received message of type {}", msg.getClass());