Boden
Boden

Reputation: 4167

Is there an easy way to monitor sessions in a tomcat web application?

I'm working on a web application using Spring MVC 2.5. I'm using Eclipse as my IDE and deploying to Tomcat 6.

I'm concerned that I don't understand how sessions work in Spring, and was wondering how I might go about monitoring session status. I know that Tomcat has various monitoring capabilities, and I can even turn them on in Eclipse...but I don't know how they work. I also think that I might be able to use the Tomcat manager application, but it doesn't seem to be running.

Anyhow, I don't want to spend the next two days configuring this. Can someone point me at a simple setup to do monitor sessions?

Upvotes: 4

Views: 6786

Answers (3)

D. Wroblewski
D. Wroblewski

Reputation: 7590

It depends on what you want to see in the session.

If you're interested in what objects are put into the session then I would add a breakpoints on session.get/set/removeAttribute and then debug. You can also add a HttpSessionListener and set breakpoints or log when the session is created/destroyed.

Another way to go is to add opensymphony/clickstream (just a jar and some jsp:s, not a separate webapp). This way you can monitor all activity (clickpaths) for each session. It's easy to modify to also show all session attributes. (google opensymphony clickstream)

Upvotes: 1

Brian
Brian

Reputation: 13571

SpringSource (Spring Framework/Rod Johnson guys) has a version of tomcat where they have put all the additional instrumentation into Tomcat

http://www.springsource.com/products/tcserver

SpringSource tc Server™ is an enterprise version of Apache Tomcat, the widely used web application server. SpringSource tc Server is hardened for enterprise use and is coupled with key operational capabilities, advanced diagnostics and is backed by mission-critical support.

Upvotes: 1

Gandalf
Gandalf

Reputation: 9855

The Tomcat Manager is the simplest way in all reality. Unless you have some custom tomcat installation, the manager is always running if tomcat is.

Upvotes: 1

Related Questions