I have a cluster of different Akka actors, all using logback as logger. In the pure Akka actors startup, I can do this during the app initialization:
MDC.put("role", role)
role being a string representing the process main role (like "worker"), and all the logs will have this additional context values, helping the investigation.
One of the role is a frontend and uses Play framework to publish a REST API. In that case, I do not define an object extending App, and I do not know how/where to set global values like that, so that all logs emitted in the play application are marked with the role (and other additional things I want to put).
Thanks !
Emmanuel