Syslog White Paper FAQ Examples JavaDoc Classloader
Protomatter Software v1.1.7

com.protomatter.syslog.xml
Class SyslogInitServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.protomatter.syslog.xml.SyslogInitServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SyslogInitServlet
extends javax.servlet.http.HttpServlet

A servlet that configures Syslog when its init() method is called. It should be configured in a WebApp by adding the following declaration to the web.xml file for the WebApp:

    <servlet>
      <servlet-name>SyslogInitServlet</servlet-name>
      <description>Syslog Initialization Servlet</description>
      <servlet-class>com.protomatter.syslog.xml.SyslogInitServlet</servlet-class>
      <init-param>
        <param-name>config.xml</param-name>
        <param-value>/path/to/syslog.xml</param-value>
      </init-param>
      <init-param>
        <param-name>show.config.on.get</param-name>
        <param-value>false</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>SyslogInitServlet</servlet-name>
      <url-pattern>/SyslogInitServlet</url-pattern>
    </servlet-mapping>

  

The config.xml init param is requred and should point to the XML configuration file for Syslog.

If the optional show.config.on.get init param is set to true (the default is false), then when the servlet is hit with a GET request, it will return the current Syslog configuration. Care should be taken when using this option since the syslog configuration file may contain database passwords, etc. It is a good idea to use declarative security to protect this servlet if you are allowing it to display the configuration file.

The <servlet-mapping> tag above is optional. If it is not specified, the servlet will still initialize syslog when the WebApp comes up, but the servlet will not be visible to web browsers. This is generally a good thing.

Also, please note that the Protomatter jar file should be placed in your system CLASSPATH and not just included in the lib directory for your WebApp. This will ensure that Syslog is available inside all software running in your application server.

See Also:
Serialized Form

Constructor Summary
SyslogInitServlet()
          Default constructor.
 
Method Summary
 void destroy()
          Showdown syslog.
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void init(javax.servlet.ServletConfig config)
          Initialize syslog.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
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

SyslogInitServlet

public SyslogInitServlet()
Default constructor.
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialize syslog.
Overrides:
init in class javax.servlet.GenericServlet

destroy

public void destroy()
Showdown syslog.
Overrides:
destroy in class javax.servlet.GenericServlet

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet

Protomatter Software v1.1.7
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.7 http://protomatter.sourceforge.net/1.1.7