tomcat 日期切分

https://www.cnblogs.com/t-road/p/6837221.html

修改tomcat的启动文件catalina.sh:

原先的结构是:

 

touch "$CATALINA_OUT"
if [ "$1" = "-security" ] ; then
......
org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_OUT" 2>&1 "&"
else
......
org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_OUT" 2>&1 "&"
fi

 

修改后的机构如下

if
[ "$1" = "-security" ] ; then ...... org.apache.catalina.startup.Bootstrap "$@" start 2>&1 \ | /usr/local/cronolog/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null & else ...... org.apache.catalina.startup.Bootstrap "$@" start 2>&1 \ | /usr/local/cronolog/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null

这个里面的
usr/local/cronolog要是自己配置的地址
./configure --prefix=/usr/local/cronolog //按自己需要指定安装路径,或不指定

 

 

posted @ 2019-06-27 22:50  IT-Jack  阅读(232)  评论(0编辑  收藏  举报