akka-rabbitmq icon indicating copy to clipboard operation
akka-rabbitmq copied to clipboard

Logging Issue

Open pietervanlillsi opened this issue 4 years ago • 2 comments

I have a problem with the logging implementation on the Connection and Channel Actors. As they use the same logger as the ActorSystem I cannot change it's level to be different from my ActorSystem?

Is there a way to set the level for the Actors by themselves?

pietervanlillsi avatar Dec 11 '19 01:12 pietervanlillsi

I don't think so. For that we probably need to create loggers inside of those actors. We would have to check if we can use the existing eco-system of Akka to do this and see if it supports log levels (as we prefer not to include more dependencies on logging libraries).

sbmpost avatar Dec 19 '19 16:12 sbmpost

Digging a bit deeper, it seems you can add your own logger to the akka.loggers configuration, after which akka will subscribe it to the event bus. This gives you the flexibility you need. More details are here: https://doc.akka.io/docs/akka/current/logging.html#loggers

An example can be found in akka.event.jul.JavaLogger (in akka actors library)

sbmpost avatar Dec 19 '19 16:12 sbmpost