Start tomcat under startup.bat under window to print catalina.out problem

In the Linux system, Tomcat will write a lot of information into the catalina.out file by default after startup. We can track the running status of Tomcat and related applications through tail -f catalina.out. On Windows, if you use startup.bat to start Tomcat, you will find that most of the logs are only output to the screen and not recorded in catalina.out. The following methods can output the console information to %CATALINA_BASE%\logs\catalina.out:

 1. Open the startup.bat file under bin and call "%EXECUTABLE%" start %CMD_LINE_ARGS%

     改为call "%EXECUTABLE%" run %CMD_LINE_ARGS% 。

2. Open the catalina.bat file under bin, you will find that there are 4 %ACTION% in total, add them separately

     >> %CATALINA_HOME%\logs\catalina.out 。

    Restart tomcat, you will find catalina.out file in the logs folder, and write all the information of the original console.

    But the output of this catalina.out file, the file will keep growing, you need to consider log rolling, log cutting, etc.

Guess you like

Origin blog.csdn.net/zzchances/article/details/105723577