修改tomcat的catalina.sh文件
修改如下:
1)将:
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
2)注释 touch "$CATALINA_OUT",约370行
# touch "$CATALINA_OUT"
3)
>> "$CATALINA_OUT" 2>&1 "&"
修改为
2>&1 |/usr/local/sbin/cronolog "$CATALINA_OUT" &
重启服务