You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
therefore JUL logging in @PreDestroy is swallowed, not logged.
This is because the uninstall was registered as a SmartLifeCycle, in LoggingApplicationListener.onApplicationPreparedEvent.
And SmartLifeCycle.stop() is called early in the AbstractApplicationContext.doClose(), before the destroyBeans().
Versions
spring-boot-2.6.13.jar / spring-boot-2.7.7.jar
jul-to-slf4j-1.7.36.jar
Context
WAR deployment
Apache Tomcat Version 9.0.53
Misc
There are multiple call paths reaching LoggingApplicationListener.cleanupLoggingSystem(). Also one for onContextClosedEvent(). but this contains shortcut code for exactly this scenario. So it looks like the SmartLifeCycle shutdown route is intentional, but unclear to me why the shutdown of Slf4JBridgeHandler should happen so early in the shutdown.