使用管道和cronolog切割日志

安装cronolog
git clone https://github.com/fordmason/cronolog
./configure
make && make install
创建管道文件
mkfifo /app/logs/access.log
修改日志写入路径
# 以nginx举例
vim nginx/conf/nginx.conf
    access_log  /app/logs/access.log  main;
启动cronolog
nohup cronolog /app/logs/access.log.%Y-%m-%d < /app/logs/access.log >> /dev/null 2>&1 &
上一篇:cronolog日志切割catalina.out


下一篇:CentOS下安装cronolog拆分tomcat日志文件catalina.out