This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Collect Servlet and JSP invocation stats in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Collect Servlet and JSP invocation stats in Tomcat" Watch "Collect Servlet and JSP invocation stats in Tomcat" New topic
Author

Collect Servlet and JSP invocation stats in Tomcat

Srinivas Thurumella
Greenhorn

Joined: Nov 15, 2004
Posts: 2
Do we have a way to collect Servlet and JSP invocation stats in Tomcat?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
You can log every access / invocation by uncommenting the AccessLogValve entry in server.xml

Bill
Srinivas Thurumella
Greenhorn

Joined: Nov 15, 2004
Posts: 2
I want to log it programatically. Like write a thread that wakes up every 5 mins and collects the number of times a Servlet has been invoked and if possible time it took to process a request.

As suggested by you, if I comment out the configuration in server.xml will it write to a file? Or do we have an API to retrieve the values?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Collect Servlet and JSP invocation stats in Tomcat