http://blog.csdn.net/starkli/article/details/51072250
http://www.linuxidc.com/Linux/2010-07/27152.htm
根据以上文章解决了在ubuntu下拆分catalina.out 日志
1.安装cronlog
wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure
make
make install
用which cronolog可以查到安装的路径,默认应该是/usr/local/sbin/cronolog,这个路径待会在修改catalina.sh时会用到。
2.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.out.%Y-%m-%d
- fi
2.2 第二步
将- touch "$CATALINA_OUT"
- #touch "$CATALINA_OUT"
2.3 第三步
将- 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 &
2.4 重新启动Tomcat
在Ubuntu下载完cronolog.tar.gz包以后,解压进入cronolog目录,运行
./configure 命令时,报以下错误:
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking whether make sets $(MAKE)… yes
checking for gcc… no
checking for cc… no
checking for cc… no
checking for cl… no
configure: error: no acceptable C compiler found in $PATH
执行make后,
提示:No targets specified and no makefile found.Stop.
执行make install后
提示:No rule to make target ‘install’.Stop.
进过上网查询,原因是系统没有安装gcc组件导致的,
sudo apt-get install gcc
执行完上述指令再安装cronolog,就没有问题了。