Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

java - Can shutdown hook give the reason of application termination?

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
      }}
question from:https://stackoverflow.com/questions/65938859/can-shutdown-hook-give-the-reason-of-application-termination

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...