为Nginx 配置Logwatch
04 Jul 2011想使用logwatch监控并分析nginx的log,结果运行了logwatch后没有nginx log的影子。
那就来配置一下吧
新建以下文件,添加以下内容并保存:
#touch /usr/share/logwatch/dist.conf/logfiles/http.conf
#vim /usr/share/logwatch/dist.conf/logfiles/http.conf
LogFile = /usr/local/nginx/logs/access.log
Archive = /home/website/logs/old/access.*.log.*.gz
# Expand the repeats (actually just removes them now)
*ExpandRepeats
# Keep only the lines in the proper date range...
*ApplyhttpDate