本文介绍了uwsgi logrotate不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设置了uwsgi logrotate的配置文件。当我测试它,它似乎它会工作。
logrotate -dvf /etc/logrotate.d/uwsgi
阅读配置文件/etc/logrotate.d/uwsgi
阅读/var/log/uwsgi/*.log的配置信息
处理1个日志
旋转模式:/var/log/uwsgi/*.log从命令行强制(5旋转)
旋转空日志文件,删除旧日志
考虑log / var / log / uwsgi / uwsgi.log
日志需要旋转
旋转日志/var/log/uwsgi/uwsgi.log,log-> rotateCount是5
dateext后缀'-20131211'
glob模式' - [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9]旋转日志失败
将/var/log/uwsgi/uwsgi.log复制到/var/log/uwsgi/uwsgi.log-20131211
truncating /var/log/uwsgi/uwsgi.log
压缩日志与:/ bin / gzip
但是cron作业被执行,没有发生任何事。什么可能是错误?我的条目是
/ var / log / uwsgi / *。log{
copytruncate
每日
dateext
rotate 5
compress
}
在cron日志我可以看到
Dec 11 03:45:01 myhost运行部分(/etc/cron.daily) 930]:完成logrotate
我可以在某处获得有关发生了什么的更多详细信息
$ p解决方案
missingok
似乎已经工作。
I have set up the configuration file for uwsgi logrotate. When I tested it, it seemed it will work.
logrotate -dvf /etc/logrotate.d/uwsgi
reading config file /etc/logrotate.d/uwsgi
reading config info for "/var/log/uwsgi/*.log"
Handling 1 logs
rotating pattern: "/var/log/uwsgi/*.log" forced from command line (5 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/uwsgi/uwsgi.log
log needs rotating
rotating log /var/log/uwsgi/uwsgi.log, log->rotateCount is 5
dateext suffix '-20131211'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
copying /var/log/uwsgi/uwsgi.log to /var/log/uwsgi/uwsgi.log-20131211
truncating /var/log/uwsgi/uwsgi.log
compressing log with: /bin/gzip
But the cron job was executed and nothing happened. What could be wrong? My entry is
"/var/log/uwsgi/*.log" {
copytruncate
daily
dateext
rotate 5
compress
}
In cron log I can see
Dec 11 03:45:01 myhost run-parts(/etc/cron.daily)[930]: finished logrotate
Can I get more details about "what happened" somewhere - a detailed output of the logrotate job?
解决方案
I tried adding
missingok
and that seems to have worked.
这篇关于uwsgi logrotate不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!