-
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://iyubo.blogbus.com/logs/42486409.html
之前找到的通过logrotate计划任务来截断lighttpd的日志目前看起来并不好用,为了更好的解决lighttpd的日志rotate,找到了cronolog。从其网站转载一段说明:
cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs.
cronolog is not just limited to rotating web server log files. In fact a community radio station in Montreal, Quebec, (CKUT 90.3 FM) uses it as part of a realtime archive/logging system of the broadcasts using open-source software.
cronolog的安装
#cd /data/software/pkg
#wget -P /data/software/ 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
修改lighttpd配置文件使用cronolog进行日志rotate
#vi /etc/lighttpd.conf
server.errorlog = "|/usr/local/sbin/cronolog /var/log/lighttpd/error/%Y/%m/%d/error.log"
accesslog.filename = "|/usr/local/sbin/cronolog /var/log/lighttpd/access/%Y/%m/%d/access.log"
保存后重启lighttpd使配置生效。如果配置成功,系统进程里将会多出两个cronolog的进程,新的日志将保存在配置目录中按照年月日建立文件夹下随机文章:
lighttpd+modcache实现对小图片的Cache 2009-07-16使用Nginx/Lighttpd作为反向代理服务器 2008-06-25Varnish无法分配内存导致自动重启子进程的问题 2009-03-11Linux下安装SVN服务器 2008-05-27解决Cacti无法正常监控超过100M以上流量的问题 2008-05-27
收藏到:Del.icio.us








