import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationDestroyService implements DisposableBean { private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationDestroyService.class); @Override public void destroy() { LOGGER.info("---服务停止了---------------------------------------------------"); } }
在springboot项目停止之后执行的方法
标签:Springboot,停止,org,import,Logger,执行,DisposableBean,LOGGER From: https://www.cnblogs.com/big-keyboard/p/16795987.html