tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Tomcat 6 Log Tomcat output to file
Date Mon, 21 Dec 2009 20:01:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard,

On 12/21/2009 9:56 AM, Richard Sayre wrote:
> I usually install Tomcat as a Service under windows which causes all
> Tomcat output to go to stdout.log.  I am in a situation where I can
> not do this.  I have to start Tomcat from the command line.  When I do
> all of Tomcats output is logged to the console.  How do I manually
> configure Tomcat so the output gets logged to a file?
> 
> I tried the instructions under the log4j section here
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> 
> When I restarted Tomcat no new log file was created.  The output
> stilled logged to the console window.

Could you specify what you did do? Posting your logging.properties file
would also be helpful.

I believe there are a few messages that Tomcat simply logs to
System.out/System.err and there's nothing you can do about that.

STARTUP.BAT calls CATALINA.BAT which, as you have seen, runs "START
java.exe ...". If you read through that mess, you'll see that no output
redirection is done. I think Windows doesn't do stdout/stderr
inheritance when one process calls another (or, at least, running
"start" escapes that). Finally, the "start" command doesn't appear to
have a "redirect stdout to a file" option.

It looks like you already tried redirecting the output of "start" to no
avail.... looks like Windows is fighting you, here.

Is Tomcat itself generating a lot of output? If you have your logging
configuration correct, very little should end up on stdout. If it's your
webapp that's spewing to stdout, check out the "swallowOutput" attribute
of the <Context> configuration element in context.xml. You'll still have
to have a sane logging configuration for this to work properly.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksv1BcACgkQ9CaO5/Lv0PC7TQCZAcgnZ4cDaEDHkdj+VlTYJE+v
xc4AoKbYIhLVGb8EiFDj2Jkz9sW91ABV
=axVp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message