Log error filter ver. 1.3


This filter lets you log error pages from your web application into server's log. So as soon as your application executes any error page (JSP attribute errorPage=true) its content will be automatically added to the system log.

How to use it:

a) download logerrorflt.jar and save it in WEB-INF/lib

b) describe a new filter in web.xml. This filter will proceed your requests:
 


<filter>
  <filter-name>LogErrorFilter</filter-name>
  <filter-class>com.cj.logerror.LogErrorFilter</filter-class>
</filter>

c) describe a mapping for this filter in web.xml. E.g.:
 


<filter-mapping>
  <filter-name>LogErrorFilter</filter-name>
  <url-pattern>*</url-pattern>
</filter-mapping>

in this example filter will be on for the each .jsp file in your application.

Also you can describe an initial parameter for this filter with page (site) error request will be redirect to after error logging. Parameter's name is redirect. If target URL starts with http than request will be redirected. Otherwise filter assumes a local resource and forwards request. E.g.:
 


<filter>
  <filter-name>LogErrorFilter</filter-name>
  <filter-class>com.cj.logerror.LogErrorFilter</filter-class>
  <init-param>
    <param-name>redirect</param-name>
    <param-value>/login.jsp</param-value>
  </init-param>
</filter>

   For downloading:

    Log error pages filter:  logerrorflt.jar

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: