• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Number of hits a tomcat take

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to find out how many hits the tomcat server is taking per day(count in number) irrespective of the applications deployed on it.
So could you please let me know how to find it.

Thanks you,
Manoj Kumar
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kmanoj,

and welcome to the JavaRanch

Maybe it would be sufficient to configure the Tomcat valve (in the server.xml file) to write an access log and use one of many tools available to analyze the aggregated logs for the time you want to count hits. The Tomcat valve in question is capable of writing access logs in common or combined format just like the famous Apache web server. So there should be enough tools to analyze these logs.

Of course it depends on your requirements. In particular if an access log really provides the information you need.

Marco
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use the "management" app - it lets you monitor lots of things such as cumulative number of requests, number of errors, current request threads etc.

I think current versions of Tomcat come with the management app but you have to configure a user role before you can get to it.

A typical Tomcat installation has html-manager-howto.html in the docs directory.

Bill
 
Saloon Keeper
Posts: 27886
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, Kmanoj!

As Marco said, there's an access log Valve that you can turn on for Tomcat and it will record the actual incoming URLs, which is good if you want to start picking apart fine-grained statistics.

For the overall stats, the Manager app will work. Depending on the version of Tomcat, this may need to be downloaded and installed separately from Tomcat. That's partly to keep the main Tomcat download smaller and partly to make Tomcat more secure, I think. To actually use the admin and manager webapps, you not only have to install them but also have to setup application security. By default that's done using a MemoryRealm that reads usernames, roles and password definitiions from the TOMCAT_HOME/conf/tomcat-users.xml file. As supplied the file has a number of commented-out sample entries. You can use them as models to set up your own secured user accounts and roles.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic