logrotate 配置是:
cat /etc/logrotate.d/nginx:
/data/logs/nginx/*.log
{
daily
dateext
dateformat .%Y-%m-%d
rotate 30
missingok
create
notifempty
sharedscripts
postrotate
[ ! -f /usr/local/nginx/logs/nginx.pid ] || kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
endscript
}
但是 nginx 将日志写入 access.log.2016-05-15,而不是 access.log
-rw-r--r-- 1 www root 0 May 14 03:46 access.log
-rw-r--r-- 1 www root 47M May 16 10:26 access.log.2016-05-15
我该如何修复它?谢谢。