public
classLog4jConfigServlet
extends HttpServlet
Overview
Inheritance
Members
Usage
Source
Books
Since12.08.2003
VersionNot specified.
Author(s)Juergen Hoeller, Darren Davison
Bootstrap servlet 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).
Note: This servlet should have a lower load-on-startup value
in web.xml than ContextLoaderServlet, when using custom Log4J
initialization.
Note that this class has been deprecated for containers implementing
Servlet API 2.4 or higher, in favor of Log4jConfigListener.
According to Servlet 2.4, listeners must be initialized before load-on-startup
servlets. Many Servlet 2.3 containers already enforce this behavior
(see ContextLoaderServlet javadocs for details). If you use such a container,
this servlet can be replaced with Log4jConfigListener. Else or if working
with a Servlet 2.2 container, stick with this servlet.
java.util.logging(which is global too).Note: This servlet should have a lower
load-on-startupvalue inweb.xmlthan ContextLoaderServlet, when using custom Log4J initialization.Note that this class has been deprecated for containers implementing Servlet API 2.4 or higher, in favor of Log4jConfigListener.
According to Servlet 2.4, listeners must be initialized before load-on-startup servlets. Many Servlet 2.3 containers already enforce this behavior (see ContextLoaderServlet javadocs for details). If you use such a container, this servlet can be replaced with Log4jConfigListener. Else or if working with a Servlet 2.2 container, stick with this servlet.