使用logrotate做nginx日志轮询
来源:互联网 发布:淘宝上靠谱的代购店 编辑:程序博客网 时间:2024/05/20 12:25
logrotate看名字就知道是专门做日志轮询的,只把任务配置放在/etc/logrotate.d/下,任务就会自动完成,而且无需安装,系统自带,比较推荐使用.
- [root@srv logrotate.d]# vi /etc/logrotate.d/nginx
配置如下
- /usr/local/nginx/logs/www.willko.cn.log /usr/local/nginx/logs/nginx_error.log {
- notifempty
- daily
- sharedscripts
- postrotate
- /bin/kill -USR1 `/bin/cat /usr/local/nginx/nginx.pid`
- endscript
- }
多个日志以空格分开,
notifempty 如果日志为空则不做轮询
daily 每天执行一次
postrotate 日志轮询后执行的脚本
这样,每天都会自动轮询,生成nginx.log.1-n
- 使用logrotate做nginx日志轮询
- 使用logrotate做nginx日志轮询
- 使用logrotate做nginx日志分割
- 使用Logrotate分割Nginx日志
- linux:使用logrotate管理nginx日志文件
- 使用 logrotate 进行 nginx 日志分割
- nginx使用logrotate对日志进行分割
- 使用logrotate管理nginx日志文件
- linux 使用logrotate做日志轮替
- logrotate切割nginx日志
- logrotate 进行nginx日志分割
- logrotate切割日志之nginx
- 用logrotate拆分nginx日志
- logrotate 做日志收集处理
- 使用logrotate 管理日志文件
- logrotate管理分割nginx日志无效
- Nginx日志切割之Logrotate篇
- logstash 用 logrotate 来做日志切分
- 类、构造函数、原型
- make and makefile
- “由于无法升级或重续本地计算机的客户端访问许可证,远程会话被中断。请跟服务器管理员联系。”问题的解决
- Sql Server 2005中的架构(Schema)
- H.264笔记
- 使用logrotate做nginx日志轮询
- 通信原理 视频
- Emma.xsl for Cruise Control
- 80后和他们的父亲们
- A simple config.xml of Cruise Control
- http 411错误
- P2P软件工作原理
- jstl ct:call 调用bean的函数
- DPL,RPL,CPL 之间的联系和区别