jump to navigation

Getting stdout from Tomcat 6 May 8, 2008

Posted by maxmil in : Java,tomcat , trackback

I am using tomcat version 6.0.14 and have been wrestling with its logging facilities. I use Log4J in my application which logs pretty much all i need to my designated log file.

However the other day i had a production error related to a hibernate query. When i turned on the hibernate show_sql property i expected the database queries to show up in the standard output of tomcat.

Since tomcat executes as a service there is no console in this version of tomcat and there is not stdout.log file in [tomcat install directory]/logs. The file used by tomcat is localhost_[datestamp].log, however my queries did not show up there either.

The solution was to add the swallowOutput attribute to my context definition with value “true”.

Comments»

1. Theo - July 14, 2008

Are you saying that you have stdout is your own logfile (a webapp’s logfile and not a logfile of tomcat?) if you do, pleae let me know how you did that,

Theo

2. maxmil - July 14, 2008

The swallow output option redirects all application output to the host log: localhost_[datestamp].log its not an application specific log file.