Package org.apache.logging.log4j.web
Class Log4jServletContextListener
java.lang.Object
org.apache.logging.log4j.web.Log4jServletContextListener
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContextListener
public class Log4jServletContextListener
extends Object
implements javax.servlet.ServletContextListener
In environments older than Servlet 3.0, this initializer is responsible for starting up Log4j logging before anything
else happens in application initialization. In all environments, this shuts down Log4j after the application shuts
down.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final TimeUnit
private Log4jWebLifeCycle
private static final String
private static final String
private static final Logger
private javax.servlet.ServletContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextDestroyed
(javax.servlet.ServletContextEvent event) void
contextInitialized
(javax.servlet.ServletContextEvent event)
-
Field Details
-
DEFAULT_STOP_TIMEOUT
private static final int DEFAULT_STOP_TIMEOUT- See Also:
-
DEFAULT_STOP_TIMEOUT_TIMEUNIT
-
KEY_STOP_TIMEOUT
- See Also:
-
KEY_STOP_TIMEOUT_TIMEUNIT
- See Also:
-
LOGGER
-
servletContext
private javax.servlet.ServletContext servletContext -
initializer
-
-
Constructor Details
-
Log4jServletContextListener
public Log4jServletContextListener()
-
-
Method Details
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event) - Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event) - Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-