maiolum
Class Log4jInitServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bymaiolum.Log4jInitServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Log4jInitServlet
extends javax.servlet.http.HttpServlet

Retrieves filesystem location of log4j external configuration file (*.lcf) from deployment descriptor file. Typically, definition of Log4jInitServlet in web.xml should be as follows:

   <servlet>
     <servlet-name>LoggerInitServlet</servlet-name>
     <servlet-class>maiolum.Log4jInitServlet</servlet-class>

     <init-param>
       <param-name>log4j-init-file</param-name>
       <param-value>WEB-INF\classes\log4j.lcf</param-value>
     </init-param>

     <load-on-startup>1</load-on-startup>
   </servlet>
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
Log4jInitServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Does nothing in this class.
 void init()
          Retrieves parameter value from deployment descriptor and passes it to org.apache.log4j.PropertyConfigurator object.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jInitServlet

public Log4jInitServlet()
Method Detail

init

public void init()
Retrieves parameter value from deployment descriptor and passes it to org.apache.log4j.PropertyConfigurator object.


doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
Does nothing in this class. Actually, not necessary in this case of servlet.