Contains classes that can be used to initialize logging within a web application.
Log4j provides a ServletContextListener that will initialize the LoggerContext for your web
application. It accepts two initialization parameters:
- log4jContextName - the name to be given to the LoggerContext. If not specified this will
default to the display-name of the web application.
- log4jConfiguration - the location of the Log4j configuration file. If the file protocol
is not specified then the file will be located both in the class path and on the file system.
If the location is a relative path the file location will be relative to the current
working directory of the running server.
The JNDIContextFilter is a Servlet Filter that can be used in conjunction with the JNDIContextSelector
to identify the LoggerContext that should be used. It accepts two parameters.
- context-name - the name to be given to the LoggerContext. A context name must be specified.
- config-location - the location of the Log4j configuration file.
The Log4j web components require at least Java 6 and at least Servlet 2.5 (or Java EE 5).