The easiest way around this is to change catalina.bat
as follows:
You need to delete all the "start" commands (which are responsible for starting up tomcat in a separate window).
Example:
Change:
set _EXECJAVA=start "%TITLE%" %_RUNJAVA%
to
set _EXECJAVA=%_RUNJAVA%
You need to change all occurrences.
Once you have made this change, you can then redirect stdout as follows:
startup.bat > ..\logs\catalina.out
Another option is to create your own startup file, say mystartup.bat
containing the following command:
java %JAVA_OPTS% -Djava.util.logging.config.file="%TOMCAT_HOME%\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs="%TOMCAT_HOME%\endorsed" -classpath "%TOMCAT_HOME%\bin\bootstrap.jar" -Dcatalina.base="%TOMCAT_HOME%" -Dcatalina.home="%TOMCAT_HOME%" -Djava.io.tmpdir="%TOMCAT_HOME%\temp" org.apache.catalina.startup.Bootstrap start
and execute it:
mystartup.bat > ..\logs\catalina.out
(Thankfully, this problem does not exist in UNIX because the catalina.sh script automatically redirects stdout/stderr to $CATALINA_OUT)