Linux与Windows系统下Cronolog安装配置
实这时最好用日志轮询,之前这个WEB服务器没有做这个配置,本应该配置WEB服务器时就应该做的。现在配置下也不晚。
1.首先得要软件http://cronolog.org/download/index.html
Version 1.6.2 released 2002-01-24 (gzip’ed tar file)
Version 1.6.1 released 1999-12-20 (gzip’ed tar file)
Win 32 version (ZIP file)
Version 1.6 released 1999-12-16 (gzip’ed tar file)
Version 1.5b9 released on 4 June 1998 (gzip’ed tar file)
Version 1.4 released 20 December 1996 (gzip’ed tar file)
如果有Windows的要下Win_32_version(ZIP file) Linux习惯用哪种包就用哪种.
2. 在Linux 下安装cronolog
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure (注意:默认是安装在/usr/local下 cronolog的命令在/usr/local/sbin下,这个要清楚)
make ; make install
3.在Windows下安装cronolog
在Windows下很简单,直接把cronolog.exe解压Copy到apache目录下的bin目录中.
4.配置都是一样的格式,不过要注意Linux和Windows下斜杠的方向.
Linux下
例:cronolog命令在/usr/local/sbin 下 日志文件在 /usr/local/apache2/logs/下
在FormatLog附近加入两句:
CustomLog “|/usr/local/sbin/cronolog logs/access_%Y%m%d.log” combined
ErrorLog “|/usr/local/sbin/cronolog logs/error_%Y%m%d.log”
Windows下
例:cronolog命令在apache的bin中 日志文件在D:/logs
CustomLog “|d:/php/apache2.2/bin/cronolog.exe D:/logs/access_%Y%m%d.log” combined
ErrorLog “|d:/php/apache2.2/bin/cronolog.exe D:/logs/error_%Y%m%d.log”
(注意:斜杠方向都在Linux下是一样的,不跟Windows的习惯一样)
如果有虚拟主机,虚拟主机也要配置,例如:
<VirtualHost *:80> ServerName www.domain.com CustomLog "|d:/php/apache2.2/bin/cronolog.exe D:/logs/access_%Y%m%d.log" combined ErrorLog "|d:/php/apache2.2/bin/cronolog.exe D:/logs/error_%Y%m%d.log" </VirtualHost> |
5.重启服务就可以看到生成了一个新的日志文件。
建议继续学习:
扫一扫订阅我的微信号:IT技术博客大学习
- 作者:zja601 来源: Zhang Jiuan' Notes
- 标签: Cronolog
- 发布时间:2010-02-26 09:04:12
-
[58] memory prefetch浅析
-
[55] 转载:cassandra读写性能原理分析
-
[49] 深入浅出cassandra 4 数据一致性问
-
[45] MySQL半同步存在的问题
-
[41] 《web前端最佳实践》—高维护性css
-
[40] 获取Dom元素的X/Y坐标
-
[39] javascript插入样式
-
[37] 字符引用和空白字符
-
[37] MySQL vs NoSQL 效率与成本之争
-
[36] 基本排序算法的PHP实现