Welcome! Log In Create A New Profile

Advanced

Re: Strange log file behavior

Grant
July 18, 2013 08:50AM
>> I noticed that most of my rotated nginx log files are empty (0 bytes).
>>
>> My only access_log directive is in nginx.conf:
>>
>> access_log /var/log/nginx/localhost.access_log combined;
>>
>> Also nginx is currently logging to
>> /var/log/nginx/localhost.access_log.1 instead of localhost.access_log.
>>
>> Does anyone know why these things are happening?
>
> This usually happens if someone don't ask nginx to reopen log
> files after a rotation. See here for details:
>
> http://nginx.org/en/docs/control.html#logs

I tried issuing kill -USR1 `cat /run/nginx.pid` manually but
nginx-1.4.1 still logged to the old file. I got the following in
error_log:

signal 10 (SIGUSR1) received, reopening logs
reopening logs

It does start logging to the new file if I restart nginx afterward. I
also noticed this in error_log from when logrotate executes:

open() "/var/log/nginx/error_log" failed (13: Permission denied)
open() "/var/log/nginx/localhost.access_log" failed (13: Permission denied)
open() "/var/log/nginx/localhost.error_log" failed (13: Permission denied)

Is something happening out of order?

- Grant

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Strange log file behavior

Grant July 14, 2013 07:46AM

Re: Strange log file behavior

Maxim Dounin July 14, 2013 02:22PM

Re: Strange log file behavior

Grant July 15, 2013 05:52AM

Re: Strange log file behavior

Maxim Dounin July 15, 2013 06:38AM

Re: Strange log file behavior

Grant July 15, 2013 06:44AM

Re: Strange log file behavior

Igor Sverkos July 15, 2013 08:54AM

Re: Strange log file behavior

Grant July 15, 2013 11:08AM

Re: Strange log file behavior

Grant July 18, 2013 08:50AM

Re: Strange log file behavior

Igor Sverkos July 18, 2013 09:16AM

Re: Strange log file behavior

Grant July 18, 2013 09:56AM

Re: Strange log file behavior

Maxim Dounin July 18, 2013 11:04AM

Re: Strange log file behavior

Grant July 18, 2013 11:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready