Redirect Tomcat 7 console log output to a file (Windows)

Viewed 42730

How do I redirect Tomcat 7 console log output to a file on Windows?

3 Answers

File: catalina.bat (in the Tomcat's root \bin directory)

Lines:

rem Comment out the line below
rem set _EXECJAVA=start "%TITLE%" %_RUNJAVA%
rem Add the line below instead
set _EXECJAVA=%_RUNJAVA%

Next, find the line making the final Java call (add the redirection as below):

%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% ... 2>&1 >c:\temp\tomcat.log

You will then get your stdout and stderr streams in the file c:\temp\tomcat.log

Related