Logging from servlet context destroyed event
问题 Within my Servlet-based application, I would like to log events for startup and shutdown. I've tried to implement the ServletContextListener interface to do this: public class DiagnosticListener implements ServletContextListener { private static final Logger LOG = LogManager.getLogger(DiagnosticListener.class); @Override public void contextInitialized( final ServletContextEvent sce ) { LOG.info("Context initialized."); } @Override public void contextDestroyed( final ServletContextEvent sce )