0

I'm trying to get logrotate to rotate the nginx error.log that sits in /var/log/nginx/error.log. I've got the following config and this is successfully rotating the website logs that sit in /var/log/nginx/website/access.log but it's not rotating the error.log on /var/log/nginx.

/var/log/nginx/*/*.log {
        daily
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 nginx adm
        sharedscripts
        postrotate
                if [ -f /var/run/nginx.pid ]; then
                        kill -USR1 `cat /var/run/nginx.pid`
                fi
        endscript
}

So based on the website logs being rotated can see the logrotate and cron setup looks good but just not too sure on the error log! Making it quite large and difficult to review on a daily basis as it's so large. 155gb on one server!

Anyone any ideas to get it rotating and compressing?

Thank you

  • What is the full pathname of error.log? – PerlDuck Dec 20 '18 at 10:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.