I have written a shutdown hook. I want to get information what was the cause of program termination. Is there any other way to find it ? The logging is not helpful in program get killed by other user/process/OS.
public class GracefulShutdown implements TomcatConnectorCustomizer, ApplicationListener<ContextClosedEvent>{ @Override public void onApplicationEvent(ContextClosedEvent event) { //Get reason of application shutdown //functionality before shutdown }}
2.1m questions
2.1m answers
60 comments
57.0k users