• 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

monitor tomcat and how to view system.out.println on the server?

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

I have a Linux server with Tomcat running for a struts application. Some users log in, manipulate their data...etc.

1. I wonder if there's any application that can show some statistics about the application in terms of -who's logged in, for how long, what tomcat is handling...etc.

2. in my application I have some system.out.println... (i do this because it shows me what am I clicking). Question is -how can I view them on the server? (In my development I see it on the eclipse's console)

thanks for any pointer.
[ August 23, 2007: Message edited by: Peter Primrose ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Peter Primrose:
Hi all,

I have a Linux server with Tomcat running for a struts application. Some users log in, manipulate their data...etc.

1. I wonder if there's any application that can show some statistics about the application in terms of -who's logged in, for how long, what tomcat is handling...etc.



This is not hard to write and is a great exercise for learning the servlet spec. I have an example app on my site that does just this:
http://simple.souther.us/not-so-simple.html
Look for SessionMonitor.



2. in my application I have some system.out.println... (i do this because it shows me what am I clicking). Question is -how can I view them on the server? (In my development I see it on the eclipse's console)



The unix 'tail' program with the -f (f is for follow) switch will keep updating the console as the file it's watching is updated.



will watch every log in the TOMCAT-INSTALL/logs directory and dump contents to the console as they are added.
[ August 22, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tip:
Questions generally stand a better chance of getting answered and already answered questions stand a better chance of being helpful to others if there is a good subject line and if the keywords in the subject line are spelled correctly.
It would be helpful if you could change the spelling of 'mintor' to 'monitor', if that's what you really mean.
You can change it by clicking the link in the top post of this thread.
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
www.javaperformancetuning.com should have a list of tools that can help.

The open source JAMon mentioned in my links below can help too.

1. I wonder if there's any application that can show some statistics about the application in terms of -who's logged in, for how long, what tomcat is handling...etc.


JAMon comes with a servlet filter in the current release that tracks page performance and whether pages are currently executing. You can also add jamon listeners via the jamon admin page to keep track of details of your slower pages.

The next release of jamon will come with a TomCat valve that will allow you to monitor anything within the Request and Response object (such as http status code, content length and more). This will be in jamon-2.7. I estimate that it will be released in 2 weeks. All this requires no code.

<<2. in my application I have some system.out.println... (i do this because it shows me what am I clicking). Question is -how can I view them on the server? (In my development I see it on the eclipse's console) >>


Jamon comes with a log4j appender that allows you to 'tail' and query the log via a jamon web page.

note jamon also comes with a jdbc proxy driver that allows you to view query performance.

See the demo below for an example of jamon running in tomcat.
[ August 22, 2007: Message edited by: steve souza ]
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks!
got some new ideas :-) will try and return with my impression
 
reply
    Bookmark Topic Watch Topic
  • New Topic