ppkarwasz commented on issue #2144: URL: https://github.com/apache/logging-log4j2/issues/2144#issuecomment-1873449006
> I'm calling `Configurator.shutdown(loggerContext);` on the `org.apache.logging.log4j.core.LoggerContext` in a custom shutdown hook that handles graceful shutdown of my application with it receives SIGTERM. It's the very last thing that happens in our shutdown hook before the application exits. You can use [`LogManager.shutdown()`](https://logging.apache.org/log4j/2.x/javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#shutdown()) from `log4j-api` to obtain the same effect. The advantage is that we can implement it in different ways for different logging backends. > This is not a "web" application and we also explicitly disable log4j's built-in shutdown hooks. Originally, we did this because we noticed that the built-in shutdown hook was running in parallel with our shutdown hook and resulted in non-deterministic log output (since the hooks were racing). We assumed it was important to shut down log4j and added the explicit shutdown. Yes, the lack of a determined order among shutdown hooks is somehow problematic. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
