Windows Server Tomcat console logs are saved to the log file, windowtomcat

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.