Class Log4jConfigServlet

  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.springframework.web.util.Log4jConfigServlet
All Implemented Interfaces:, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Log4jConfigServlet
extends javax.servlet.http.HttpServlet

Bootstrap servlet for custom Log4J initialization in a web environment. Simply delegates to Log4jWebConfigurer.

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 favour of Log4jConfigListener.
According to Servlet 2.4, listeners must be initialized before load-on-startup servlets. Many Servlet 2.3 containers already enforce this behaviour (see ContextLoaderServlet javadoc 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.

Juergen Hoeller, Darren Davison
See Also:
Log4jWebConfigurer, Log4jConfigListener, ContextLoaderServlet, Serialized Form

Constructor Summary
Method Summary
 void destroy()
 void doService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This should never even be called since no mapping to this servlet should ever be created in web.xml.
 java.lang.String getServletInfo()
 void init()
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Log4jConfigServlet()
Method Detail


public void init()


public void destroy()


public void doService(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
This should never even be called since no mapping to this servlet should ever be created in web.xml. That's why a correctly invoked Servlet 2.3 listener is much more appropriate for initialization work ;-)



public java.lang.String getServletInfo()

Copyright (C) 2003-2004 The Spring Framework Project.