You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Siva Chinnasamy <si...@labs.gte.com> on 2002/08/05 22:59:26 UTC

Valves vs Filters

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.

TIA.
  Siva.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>