tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siva Chinnasamy" <>
Subject Valves vs Filters
Date Mon, 05 Aug 2002 20:59:26 GMT
Hi folks,

I have a general question. For a high traffic web application (jsp/servlets
+ beans - no EJB), I am considering three different logging approaches.

1. A custom AccessLogValve or
2. Filters as in Servlets 1.3 specs.
3. Custom light weight per-thread logging bean using log4j

Case (1) and (2) are similar. In both cases, the jsps write the relevant
logging information to ServletHttpRequest/Response object and rely on the
Valve or filter to do the timestamping. In case 3, the jsps just invoke a
method in the custom bean for logging but have to take care of timestamping.

There are some static heavy weight beans that need more flexibility in
logging and do not necessarily operate on a per request basis. Case (3) or
Case (2) in conjunction with (3) is most suited for them. I welcome
comments/ suggestions from all, especially with respect to the differences
between cases (1) and (2).
Using Valves ties up the application to tomcat internals. However it does
have a benefit in that the Tomcat access logging and application logging
will be in one file. I would like to know whether there will be any
difference in Timing values since Valves have internal access to life cycle
for the request.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message