一、cronolog安装
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
二、nginx日志配置
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name xxx.xxx.xxx.xxx;root /data/sq/install_package/;
access_log /home/test/workspace/nginx/logs/access.log;
}
三、先创建一个命名管道
mkfifo /home/test/workspace/nginx/logs/access.log