简体   繁体   中英

Write Tomcat 5.5 output to one of Tomcat's log files

I'd like that all the output that is shown in Tomcat's console will be saved into a file including the output on startup and shutdown of Tomcat.
How can I do this?
I looked at apache documentation about logging , Do I need to change something in the logging.properties can I trust log4j to write message from the first message on startup to the last message on shutdown?

Temporary workaround that I found is to change catalina.bat
from set _EXECJAVA=start "Tomcat" %_RUNJAVA%
to set _EXECJAVA=%_RUNJAVA%
so running tomcat will not open new console but use the same one and when I suspend tomcat (ctrl c) It will not close the console so I could keep read the output.

If you're in Solaris or similar try:

  • nohup /path/to/tomcat/bin/startup.sh &

That'll write everything from the start to a file called nohup.out in the folder where you issued the command.

Don't know if that suites you thou.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM