一、首先安装cronolog-1.6.2
1、下载
wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
2、安装
# tar zxvf cronolog-1.6.2.tar.gz
# cd cronolog-1.6.2
# ./configure
# make
# make install
3、查看cronolog安装后所在目录(验证安装是否成功)
# which cronolog(一般情况下显示为:/usr/local/sbin/cronolog)
4、查找
if [ -z "$CATALINA_OUT" ] ; then
CATALINA_OUT="$CATALINA_BASE"/logs/catalina..out
fi
修改为:
if [ -z "$CATALINA_OUT" ] ; then
CATALINA_OUT="$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out
fi
5、查找 touch "$CATALINA_OUT"
注释掉 #touch "$CATALINA_OUT"
6、查找两处 "$CATALINA_OUT" 2>&1 "&"
org.apache.catalina.startup.Bootstrap "[email protected]" start \
>> "$CATALINA_OUT" 2>&1 "&"
修改为:
org.apache.catalina.startup.Bootstrap "[email protected]" start \
| /usr/local/sbin/cronolog "$CATALINA_OUT" >> /dev/null &
时间: 2024-10-12 22:04:04