Might be important for flushing/closing async appenders.
If shutdown is added with logback.xml configuration I suspect that it may run before ActorSystem shutdown since order of jvm hooks are undefined.
Since there might be several ActorSystems in same JVM we can't just do it after AS termination.
Attn: @marcospereira @ignasi35 this might impact Play, too.
Play disables Akka's shutdown hook, and it stops the logging framework from a CoordinatedShutdown.PhaseBeforeActorSystemTerminate task. That might be too early, if the ActorSystem logs anything while terminating.
stops the logging framework from a CoordinatedShutdown.PhaseBeforeActorSystemTerminate task. That might be too early, if the ActorSystem logs anything while terminating.
yes, that might be too early. Might be better via ActorSystem.whenTerminated or the Future returned by CoordinatedShutdown.run.
For Akka itself we probably also have to consider that that logback can be shared by several ActorSystems in same JVM.
Play disables Akka's shutdown hook, and it stops the logging framework from a
CoordinatedShutdown.PhaseBeforeActorSystemTerminatetask. That might be too early, if theActorSystemlogs anything while terminating.
That code requires a review. The shutdown task should be renamed and the Logger should be stopped from somewhere else.
(better continue this discussion on an issue in playframework/playframework/.
Most helpful comment
Attn: @marcospereira @ignasi35 this might impact Play, too.
Play disables Akka's shutdown hook, and it stops the logging framework from a
CoordinatedShutdown.PhaseBeforeActorSystemTerminatetask. That might be too early, if theActorSystemlogs anything while terminating.