Get the App
SLTechnology News&Howtos  ›  Servers  › 

Tomcat's method of using cronolog to cut logs

Shulou Source: shulou.com Published: 2022-06-03 06:08:27 09月21日 Update

This article is to share with you the method of using cronolog to cut logs in Tomcat. I believe most people have not yet learned this skill. In order to let you learn, I have summarized the following content. Without saying much, let's read on.

First, install cronologyum-y install cronolog II, configure tomcatvim / usr/local/tomcat-xxx/bin/catalina/sh1, original picture

Replace it with the following 1. Delete line 416 2 and replace org.apache.catalina.startup.Bootstrap "$@" start\ > > "$CATALINA_OUT" 2 > & 1 "&" with the following two places: org.apache.catalina.startup.Bootstrap "$@" start 2 > & 1 | / usr/sbin/cronolog "$CATALINA_BASE" / logs/catalina.%Y-%m-%d.log > / dev/null 2 > & 1 &

3. Restart tomcat with the following results

After reading the above, have you mastered the method of using cronolog to cut logs in Tomcat? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Content methods logs skills more original text pictures most effects look articles industry information channels channels configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Microsoft Shulou Technology Shulou Tech Info vpn