1

We're running Nginx on a couple Ubuntu servers (16.04) and all in all everything is working fine. However after some time (few days) Nginx stops logging requests to the logs (/var/log/nginx/[host].config). If I restart Nginx logging resumes/starts back up. But pretty frustrating as I don't know exactly when logging stops and all in all, don't want to not be logging the traffic.

Thoughts on what could be causing this or how to fix?

Logrotate config:

/var/log/nginx/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    create 0640 www-data adm
    sharedscripts
    prerotate
        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
            run-parts /etc/logrotate.d/httpd-prerotate; \
        fi \
    endscript
    postrotate
        invoke-rc.d nginx rotate >/dev/null 2>&1
    endscript
}
  • How have you configured log rotation? – Michael Hampton Jan 11 at 19:44
  • Updated the question with the logrotate config. This is the default config that was loaded when installing nginx (never looked at until now). – djneely yesterday

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.