eddyP23
eddyP23

Reputation: 6825

Log after actor system has been shutdown

I am using log method from with ActorLogging to make logs. I would like to make a few logs after the system is shut down, but that is not working, as I would assume it uses system for logging. What I would like to do looks like that:

  logger.info("Shutting down actor system.")

  context.system.shutdown()
  context.system.registerOnTermination {
    logger.info("Actor System terminated, stopping loggers and exiting.")
    loggerContext.stop()
  }

Are there any workarounds to this problem?

Thanks!

Upvotes: 1

Views: 113

Answers (1)

MirMasej
MirMasej

Reputation: 1622

You can use just slf4j (backed for instance by logback) directly as described here.

Upvotes: 1

Related Questions