Spring Boot Incident ApplicationListener

ApplicationStartedEvent : The event executed when spring boot starts.
ApplicationEnvironmentPreparedEvent : Spring boot's corresponding Environment has been prepared, and the context has not been created.
ApplicationPreparedEvent : The spring boot context is created, and the bean is not loaded.
ApplicationFailedEvent : The event is executed when spring boot starts abnormally.




Implement the ApplicationListener interface, Override the corresponding method
Modify the main method and add a custom listener implementation with SpringApplication's addListeners

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326945877&siteId=291194637