org.springframework.web.util

## Class Log4jConfigListener

- java.lang.Object
- - org.springframework.web.util.Log4jConfigListener

All Implemented Interfaces:
  EventListener, ServletContextListener

    public class Log4jConfigListener
    extends Object
    implements ServletContextListener

Bootstrap listener for custom log4j initialization in a web environment. Delegates to `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.

Since:
  13.03.2003
Author:
  Juergen Hoeller
See Also:
  `Log4jWebConfigurer`, `ContextLoaderListener`, `WebAppRootListener`

### Constructor Summary

Constructors
Constructor and Description
`Log4jConfigListener()`

### Method Summary

Methods
`void` `contextDestroyed(ServletContextEvent event)`
`void` `contextInitialized(ServletContextEvent event)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Log4jConfigListener

    public Log4jConfigListener()

### Method Detail

#### contextInitialized

    public void contextInitialized(ServletContextEvent event)

Specified by:
  `contextInitialized` in interface `ServletContextListener`

#### contextDestroyed

    public void contextDestroyed(ServletContextEvent event)

Specified by:
  `contextDestroyed` in interface `ServletContextListener`