File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes How to get the applicaiton usage report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get the applicaiton usage report" Watch "How to get the applicaiton usage report" New topic

How to get the applicaiton usage report

gowrishankar sundararajan

Joined: Apr 10, 2007
Posts: 6
Hi all,

i have hosted a applicaiton in tomcat http://localhost:8080/sample

wanted to know if we can track the number of hits this applicaiton takes

i need to store it and retrieve it later.

can i get some inputs on the same?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

As I recall. Tomcat has a way to configure access logs. But it's been a long time since I've used that so I don't know the details.

Someone more Tomcat-savvy might chirp in, or you could start looking through the Tomcat docs.

[Asking smart questions] [About Bear] [Books by Bear]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
You could configure a servlet filter for all servlets/JSPs, and do the appropriate accounting in that.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

In tomcat/conf/server.xml, look for access-logging.
Select the logger you want to use (there is a description of each in the comments) and uncomment the valve for the logger you want to use.
Restart tomcat and the access logs will start showing up in tomcat/logs.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: How to get the applicaiton usage report
It's not a secret anymore!