度娘:cronolog-1.6.2.tar.gz,很好找
# tar zxvf cronolog-1.6.2.tar.gz
3、进入cronolog安装文件所在目录
# cd cronolog-1.6.2
4、运行安装
# ./configure
# make
# make install
(或者:./configure && make && make install)
5、查看cronolog安装后所在目录(验证安装是否成功)
# which cronolog
一般情况下显示为:/usr/local/sbin/cronolog
要想分割tomcat7的catalina.out,需作如下工作:
修改文件内容:Tomcat/bin/catalina.sh,
1、搜索“CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out”
修改为“CATALINA_OUT="$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out”
2、搜索“touch "$CATALINA_OUT”
把 org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_OUT" 2>&1 "&"
改为
org.apache.catalina.startup.Bootstrap "$@" start 2>&1 \
| /usr/local/sbin/cronolog "$CATALINA_OUT" >> /dev/null &
因为在文件档中有多个地方出现
org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_OUT" 2>&1 "&"
所以一定要确定,是在“touch "$CATALINA_OUT”下的那两个。
over