Hi Konstantin,

On 23.03.2022 23:29, Konstantin Kolinko wrote:
> ср, 23 мар. 2022 г. в 14:12, Rony G. Flatscher (Apache) <r...@apache.org>:
>> skip...
>>
>> startup.bat uses start to run catalina.bat in a new cmd window with:
>>
>>     call "%EXECUTABLE%" start %CMD_LINE_ARGS%
>>
>> catalina.bat then starts Tomcat as:
>>
>>     %_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% 
>> %CATALINA_OPTS% %DEBUG_OPTS%
>>     -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%"
>>     -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%"
>>     -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% 2>&1 1>
>>     D:\orx.debug\work_rii_tomcat\test.log
>>
>> This does not work.
> (It does not matter, but you somehow lost "%ACTION%" at the end of the
> above line.)
>
> If I prefix the above line with "echo" to see what command is being
> executed, like this:
>
> echo %_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER%
> %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS%
> -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%"
> -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%"
> -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS%
> %ACTION% 1>>mylog.txt 2>&1
>
> then I get the following results:
>
> a) After calling "startup.bat" or "catalina.bat start" I see the
> following in mylog.txt:
>
> start "Tomcat" "C:\pathtojava\java.exe" .....
> org.apache.catalina.startup.Bootstrap start
>
> b) After calling "catalina.bat run" I see the following:
>
> "C:\pathtojava\java.exe" ..... org.apache.catalina.startup.Bootstrap start
>
> Note the difference.
>
> It is the "start" command that creates a new window.  The "call"
> command that you mentioned is just a command to execute a different
> batch file and return to continue executing the original batch file.
>
> BTW, commands "help start" and "help call" print some reference for
> those commands.
>
>
> Looking at the reference for "start", I think your only option is to
> use "catalina.bat run" to start Tomcat. When I do so, the redirection
> works as expected.
>
>
> The following also works, without any modifications to the catalina.bat file:
>
>     catalina.bat run 1>>mylog.txt 2>&1
>
> or with remote debugging being enabled:
>
>     catalina.bat jpda run 1>>mylog.txt 2>&1

thank you very much for your information and explanations which solves this, 
many thanks!

(Was not aware of "catalina.bat run" and the like, adding to that your 
step-by-step explanations
made it a breeze to get this up and running as a result!)

Kudos!

---rony



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

Reply via email to