我最近inheritance了一个服务器,看到/var/log/varnish中有varnish.log文件,目前正在向上推送300G文件大小。 当我运行varnishlog时,我看起来像是获取数据的varnishlog 。
我似乎无法find哪里清漆设置为login在第一位。 在我的/etc/varnish/default.vcl文件中没有参考。
在/etc/default/varnish我的varnishlog文件全部注释掉了,具体是:
# Uncomment this to enable logging for varnish. Please make sure you have # enough disk space for significant amounts of log data. To disable logging, # set the variable to "0", "no", or leave it unset.
默认设置似乎不启用日志logging,所以我想知道还有哪些地方可以打开?
不,它正在积极地被写入。 tail -f on varnish.log运行tail -f on varnish.log显示inputstream。
任何指导赞赏。
尝试修改你的logrotate脚本
/var/log/varnish/*.log { daily rotate 7 missingok size 50M compress delaycompress missingok postrotate if [ -d /run/systemd/system ]; then systemctl -q is-active varnishlog.service || exit 0 fi /usr/sbin/invoke-rc.d varnishlog reload > /dev/null endscript }
我将/var/log/varnish/varnish.log更改为* .log,以便处理varnish.log和varnishnsca.log。 当它达到50M时,我增加了50M大小来旋转日志。 在这一点上,我会尝试用logrotate强制更改。 首先尝试使用-d标志来查看输出是否改变。 如果它说可以在debugging模式下旋转,请尝试logrotate -f /etc/logrotate.d/varnish