Windows Server Tomcat console logs are saved to the log file, windowtomcat
In Linux, many messages are written to the catalina. out file by default after Tomcat is started. We can track Tomcat and related applications through tail-f catalina. out. In windows, we use startup. after bat starts Tomcat, it will find that the catalina log is very different from the content recorded in Linux. Most of the information is output only to the screen and not recorded in catalina. out. The content of this article is to be implemented in windows, and relevant console output records should be recorded in the catalina. out file in the background for future viewing.
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 %
ChangeCall "% EXECUTABLE %" run % CMD_LINE_ARGS %
Note: After the preceding settings, logs will not be displayed in the tomcat running window in real time after tomcat is run.
2,Open the catalina. bat file under bin and you will find that there are 4% ACTION % in the file, and add
>>% CATALINA_HOME % \ logs \ catalina. outNote: In windows, the backslash and linux are reversed. Restart tomcat and you will find that the catalina. out file appears in the logs folder, which writes all the information in the console. However, the output catalina. out file keeps growing, that is, the file will become larger and larger.
3 .,According to the above modification, all tomcat logs will be written to the logs/catalina. out file. If you want to generate the log file by day, you can add it after % ACTION %
>>% CATALINA_HOME % \ logs \ catalina. % date :~ 0, 4%-% date :~ 5, 2%-% date :~ 8, 2%. outNote: The generated format is catalina. yyyy-mm-dd.out (yyyy represents a 4-digit year, mm represents a 2-digit month, and dd represents a two-digit date)
4,You can use the hoo wintail software to open the catalina. out file and view the logs as in linux. Note: The free cracked version of wintail is provided for test. Link: https://pan.baidu.com/s/1jJmIg9C password:
1imf
Refer to blog: Https://www.cnblogs.com/Warmsunshine/p/6236076.html