-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Document logging.register-shutdown-hook and why you may want to enable it #24507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can opt in for this by setting |
Thanks for the information. I was reading through the related tickets and they were very helpful. It seems the logging system shutdown hook is run before We will probably add a bean with the lowest precedence lifecycle (last one running) and close the logger context there, since it seems simple enough and will work for us. It might not be idiomatic but it will work. |
I stumbled on this issue by accident and can definitely say that better documentation would be appreciated! We also use Logback in our application and if setting |
Logback's documentation recommends stopping the context on shutdown to flush the loggers and let appenders terminate properly.
https://logback.qos.ch/manual/appenders.html#AsyncAppender
https://logback.qos.ch/manual/configuration.html#stopContext
This doesn't appear to be happening during
LogbackLoggingSystem.cleanUp()
. Is there perhaps a reason for Spring Boot not to callstop()
onLoggerContext
? Are the users expected to do this instead?The text was updated successfully, but these errors were encountered: