1. 下载 wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
2. 编译安装:
tar xvjf cronolog-1.6.2.tar.gz
./configure
make
make install
于是cronolog会安装到/usr/local/sbin/cronolog
3. 自定义日志格式:
vi /etc/httpd/conf/httpd.conf
#设置apache的环境变量,过滤图片
SetEnvIf Request_URI (gif|png|jpe?g|tiff?)$ THISISIMAGE=1
CustomLog "|/usr/local/sbin/cronolog /web/logs/access_log-%Y-%m.log" combined env=!THISISIMAGE