To output the Tomcat console log information by Time (day) in the file

Source: Internet
Author: User
Modify the Startup.bat file in Tomcat's Bin directory,
Put 42 lines of:
Call "%executable%" Start%cmd_line_args%
To
Call "%executable%" Run%cmd_line_args% >>. \logs\wudengke213.log
or instead
Call "%executable%" Run%cmd_line_args% >>. \logs\console.%date:~0,10%.log

The first way is to produce only one log file, the second is a log file every day


%date:~0,10% is the system time interception, some systems may not be such interception, you can use the Echo%date% command to look at the results, 0 is the starting position, 10 o'clock length, according to the results to intercept.
The purpose of adding this line is to have Tomcat output the console's information to
.. \logs\xxx_%date:~0,10%.log
This file, but the console does not output, this is his shortcoming, but if it is in the user environment deployment, the console output is not important
3. The above approach cannot be entered into a file on a daily basis, and the second method can only be output to different files when you restart Tomcat on a different date, such as restarting the system on the same day, or the same log file.


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.