tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Logger
Date Wed, 01 Nov 2000 01:25:35 GMT
"Lacerda, Wellington (AFIS)" wrote:

> Hi Craig,
>
> I need a logger to collect data on tomcat contexts usage. I want to know how
> many hits a certain context got, what is the most popular page, how many
> hits from inside versus from the outside,
> things like that. I was thinking on something like writing a
> RequestInterceptor for that. Is that the way or there are less painful paths
> ?
>

You've got it -- a RequestInterceptor for Tomcat 3.x, or a Valve for Tomcat 4.0,
would let you watch requests as they go by and count/log them.

In Tomcat 4.0, you've got one additional option, courtesy of the new filter
support in servlet 2.3.  You can write a web-app level Filter class, and
configure it to process all requests for URL pattern "/*".  That way, you can do
counting or logging activities without having to modify your servlets or JSP
pages at all, and without having to write any server-specific code like a
RequestInterceptor or a Valve.


> Wellington

Craig



Mime
View raw message