You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brian Burridge <ma...@burridge.net> on 2001/04/16 16:02:56 UTC

Where does System.out.println go under Tomcat

I've put some system out prints in my JSP pages, but I cannot find the error logs. I've found the logs for the web site (apache's standards logs) and I've found a servlet.log and a jasper.log under the jakarta logs directory, but I have no idea where servlet errors go.

Brian

Re: Where does System.out.println go under Tomcat

Posted by Sam Newman <sa...@stamplets.com>.
Hmm, well they will get displayed in the terminal you started tomcat from.
Unless you redirect output from the command line argument you use to start
tomcat, you'll probably loose it (e..g. use command 2> to redirect stderr to
a file, 1> to redirect stdout). I've changed all of my debug prints to login
to a servlet context - e.g. servlet.getServletContext().log(msg, exp). I'm
not sure of the .jsp version. You could write a logging servlet to do it I
guess, and call it from the jsp. Outputs from the context.log() go to the
servlet.log in the tomcat/logs directory. Have a look at the docs for
HttpServletContext

sam
----- Original Message -----
From: Brian Burridge
To: tomcat-user@jakarta.apache.org
Sent: Monday, April 16, 2001 3:02 PM
Subject: Where does System.out.println go under Tomcat


I've put some system out prints in my JSP pages, but I cannot find the error
logs. I've found the logs for the web site (apache's standards logs) and
I've found a servlet.log and a jasper.log under the jakarta logs directory,
but I have no idea where servlet errors go.

Brian


Re: Where does System.out.println go under Tomcat

Posted by Brian Burridge <ma...@burridge.net>.
I am using Unix, but when I do a System.out.println the message does not come to my terminal window. Also, I added this to my startup.sh:
 1>>$TOMCAT_HOME/stdout.log 2>>$TOMCAT_HOME/stderr.log 

and it did not redirect my system.outs to either log file.

Under both ServletExec and Jrun, any System.out's done within JSP actually go to a special error log and not to stout. Does Tomcat not have that?

Brian
  ----- Original Message ----- 
  From: Kevin Sangeelee 
  To: tomcat-user@jakarta.apache.org 
  Sent: Monday, April 16, 2001 10:13 AM
  Subject: Re: Where does System.out.println go under Tomcat



  The logs just go to stdout as normal. Assuming you're using a Unix
  variant, when you run startup.sh from a console, the stdout output goes to
  the console window by default. If you log out then you'll lose any further
  output, but Tomcat will continue as normal.

  I redirect stdout and stderr to separate files from
  $TOMCAT_HOME/bin/startup.sh as follows:

  $BASEDIR/tomcat.sh start "$@" >>$TOMCAT_HOME/stdout.log 
  2>>$TOMCAT_HOME/stderr.log

  Kevin

  On Mon, 16 Apr 2001, Brian Burridge wrote:

  > I've put some system out prints in my JSP pages, but I cannot find the
  > error logs. I've found the logs for the web site (apache's standards
  > logs) and I've found a servlet.log and a jasper.log under the jakarta
  > logs directory, but I have no idea where servlet errors go.


Re: Where does System.out.println go under Tomcat

Posted by Kevin Sangeelee <ke...@susa.net>.
The logs just go to stdout as normal. Assuming you're using a Unix
variant, when you run startup.sh from a console, the stdout output goes to
the console window by default. If you log out then you'll lose any further
output, but Tomcat will continue as normal.

I redirect stdout and stderr to separate files from
$TOMCAT_HOME/bin/startup.sh as follows:

$BASEDIR/tomcat.sh start "$@" >>$TOMCAT_HOME/stdout.log 
2>>$TOMCAT_HOME/stderr.log

Kevin

On Mon, 16 Apr 2001, Brian Burridge wrote:

> I've put some system out prints in my JSP pages, but I cannot find the
> error logs. I've found the logs for the web site (apache's standards
> logs) and I've found a servlet.log and a jasper.log under the jakarta
> logs directory, but I have no idea where servlet errors go.