You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/11/01 02:25:35 UTC

Re: Logger

"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