public class Log4jConfigListener extends Object implements javax.servlet.ServletContextListener
Log4jWebConfigurer
(see its javadoc for configuration details).
WARNING: Assumes an expanded WAR file, both for loading the configuration
file and for writing the log files. If you want to keep your WAR unexpanded or
don't need application-specific log files within the WAR directory, don't use
log4j setup within the application (thus, don't use Log4jConfigListener or
Log4jConfigServlet). Instead, use a global, VM-wide log4j setup (for example,
in JBoss) or JDK 1.4's java.util.logging
(which is global too).
This listener should be registered before ContextLoaderListener in web.xml
when using custom log4j initialization.
Log4jWebConfigurer
,
ContextLoaderListener
,
WebAppRootListener
Constructor and Description |
---|
Log4jConfigListener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event) |
void |
contextInitialized(javax.servlet.ServletContextEvent event) |
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed
in interface javax.servlet.ServletContextListener
Copyright © 2015. All rights reserved.