Tomcat's method of using cronolog to cut logs
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!