如何在Vesta CP中增加/旋转Nginx日志

问题描述

我正在使用带有Nginx的Vesta CP作为Apache的代理,并且我需要一个域的Nginx访问日志超过3-4天,但是当我检查/home/admin/web/domain/logs/domain.log

它包含一个日志非常有限的文件,该文件每天都会更新,以前的日志也会被清除。

我尝试通过以下配置弄乱logrotate

/home/admin/web/domain/logs/log/*log {
    create 0644 nginx nginx
    daily
    rotate 10
    missingok
    notifempty
    compress
    sharedscripts
    postrotate
    [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
    endscript
}

但它不起作用。

当我检查Apache日志时,它们被完美地旋转了。但我希望轮换我的域的nginx访问日志或至少将其存储3-4天。

除了logrotate之外,我不知道是否有其他解决方案。

请帮助...

PS。 我不明白为什么我们要将这一行放在logrotate conf中,一些指导会很有帮助。

[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)