Package org.apache.logging.log4j.web
Interface Log4jWebLifeCycle
- All Superinterfaces:
LifeCycle
,Log4jWebSupport
- All Known Implementing Classes:
Log4jWebInitializerImpl
Specifies an interface for initializing and deinitializing Log4j in a Java EE web application. The default and only
implementation is
Log4jWebInitializerImpl
. The initializer is based on an interface to improve testability.
The methods here are contained in a package-private sub-interface because general application code should not have
access to them.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from interface org.apache.logging.log4j.web.Log4jWebSupport
CONTEXT_ATTRIBUTE, IS_LOG4J_AUTO_INITIALIZATION_DISABLED, IS_LOG4J_AUTO_SHUTDOWN_DISABLED, IS_LOG4J_CONTEXT_SELECTOR_NAMED, LOG4J_CONFIG_LOCATION, LOG4J_CONTEXT_NAME, SUPPORT_ATTRIBUTE
-
Method Summary
Methods inherited from interface org.apache.logging.log4j.core.LifeCycle
getState, initialize, isStarted, isStopped
Methods inherited from interface org.apache.logging.log4j.web.Log4jWebSupport
clearLoggerContext, setLoggerContext, wrapExecution
-
Method Details
-
start
void start()Starts up Log4j in the web application. CallsLog4jWebSupport.setLoggerContext()
after initialization is complete.- Specified by:
start
in interfaceLifeCycle
- Throws:
IllegalStateException
- if a JNDI config location is specified but no name is specified.
-
stop
void stop()Shuts down Log4j in the web application. CallsLog4jWebSupport.clearLoggerContext()
immediately before deinitialization begins.
-