aspose file tools*
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
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get the applicaiton usage report" Watch "How to get the applicaiton usage report" New topic
Author

How to get the applicaiton usage report

gowrishankar sundararajan
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 61239
    
  66

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] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Ben Souther
Sheriff

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
 
jQuery in Action, 2nd edition
 
subject: How to get the applicaiton usage report