net.sourceforge.log4ajax.web.filter
Class Log4AjaxFilter

java.lang.Object
  |
  +--net.sourceforge.log4ajax.web.filter.Log4AjaxFilter
All Implemented Interfaces:
javax.servlet.Filter

public class Log4AjaxFilter
extends java.lang.Object
implements javax.servlet.Filter

Log messages from client side AJAX applications using the underlying logging mechanism. Simplistic assumptions are made as to the format of the incoming messages and therefore the parsing code is extremly trivial.

Author:
Eric Spiegelberg
See Also:
Log4Ajax

Constructor Summary
Log4AjaxFilter()
           
 
Method Summary
 void destroy()
          Empty implementation.
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp, javax.servlet.FilterChain chain)
          Read the incoming request and log the message at the appropriate level.
 void init(javax.servlet.FilterConfig fc)
          The usual basic implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4AjaxFilter

public Log4AjaxFilter()
Method Detail

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse resp,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Read the incoming request and log the message at the appropriate level. This example shows grabbing the userId from the HttpSession and capturing it in the log. Other application specific information could be captured as well.

Specified by:
doFilter in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
See Also:
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)

init

public void init(javax.servlet.FilterConfig fc)
          throws javax.servlet.ServletException
The usual basic implementation.

Specified by:
init in interface javax.servlet.Filter
javax.servlet.ServletException
See Also:
Filter.init(javax.servlet.FilterConfig)

destroy

public void destroy()
Empty implementation.

Specified by:
destroy in interface javax.servlet.Filter
See Also:
Filter.destroy()


Copyright © 2005 Object Partners Inc.. All Rights Reserved.