Fixes #26953
I think the we can programmatically disabling log4j shutdown hook when initialize, since SpringApplicationShutdownHook will handle shutdown. I noticed in the previous version(before 2.5.1), spring shutdown hook is executed before log4j2 shutdown hook,so no exception throws.
Or we can try catch in shutdownhandler to ignore the exception, exception means log context has been removed, so created a one will throw excpetion .I perfer the try catch method, since the previous is not Configurable.
Comment From: pivotal-cla
@vikeychen Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@vikeychen Thank you for signing the Contributor License Agreement!
Comment From: snicoll
@vikeychen thank you for the PR but catching ClassCastException
is not an approach we're keen to take. We're exploring other options to fix this issue.