Welcome! Log In Create A New Profile

Advanced

Re: Nginx not logging to socket

June 24, 2015 07:06PM
> On Jun 24, 2015, at 10:45 AM, Vladimir Homutov <vl@nginx.com> wrote:
>
>> On Wed, Jun 24, 2015 at 10:21:06AM -0400, Danomi Czaski wrote:
>>> On Wed, Jun 24, 2015 at 10:00 AM, Vladimir Homutov <vl@nginx.com> wrote:
>>>> On Wed, Jun 24, 2015 at 08:31:31AM -0400, Danomi Czaski wrote:
>>>>> On Wed, Jun 24, 2015 at 7:03 AM, Vladimir Homutov <vl@nginx.com> wrote:
>>>>>> On Wed, Jun 24, 2015 at 06:12:49AM -0400, Danomi Czaski wrote:
>>>>>> Hello,
>>>>>>
>>>>>> On Sun, Jun 21, 2015 at 8:19 AM, Andrew Holway
>>>>>> <andrew.holway@otternetworks.de> wrote:
>>>>>>> Hallo!
>>>>>>>
>>>>>>> Using rsyslog I have set up a logging socket and confirmed that its working
>>>>>>> by piping in some stuff to "logger -u /dev/log"
>>>>>>> nginx/1.8.0 does not seem to be dumping in logs however. The nginx config is
>>>>>>> below..
>>>>>>
>>>>>> Any luck? I'm seeing the same problem on 1.7.12.
>>>>>
>>>>> do you see some errors in the local error log? If nginx is unable to
>>>>> send data to socket for some reasons (check socket permissions, selinux
>>>>> and similar), you will see errors in the local log file.
>>>>
>>>> My config looks like:
>>>>
>>>> error_log syslog:server=unix:/dev/log;
>>>>
>>>> The only error I see is that nginx can't open /var/log/nginx/error.log.
>>>>
>>>> $ nginx -t
>>>> nginx: [alert] could not open error log file: open()
>>>> "/var/log/nginx/error.log" failed (2: Unknown error)
>>>> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
>>>> nginx: configuration file /etc/nginx/nginx.conf test failed
>>>>
>>>> Of course /var/log/nginx isn't there because I'm trying to use syslog.
>>>> If I create /var/log/nginx, nginx starts and I'll see debugging logs
>>>> there but nothing related to syslog problems.
>>>>
>>>> The permissions on /dev/log look fine:
>>>>
>>>> $ ls -l /dev/log
>>>> srw-rw-rw- 1 root root 0 Jun 24 12:41 /dev/log=
>>>
>>> did you try increasing log level? If there are no errors, nginx will
>>> not write anything to log in your case.
>>>
>>> you can add one more error_log directive and point it to some local
>>> file with write permissions to check there for possible errors.
>>
>> Okay, I see messages going to syslog, I had to increase the log level
>> as you said. Thanks.
>>
>> It seems like there _must_ be a file logger or nginx won't start. If I
>> don't want any log file it looks like I have to do something like:
>>
>> error_log /dev/null emerg;
>> error_log syslog:server=unix:/dev/log debug;
>
> This is intentionally: syslog is not reliable and nginx by default will
> write logs to files. And there is a simple workaround - you

Thank you for your help.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx not logging to socket.

Andrew Holway June 21, 2015 08:20AM

Re: Nginx not logging to socket.

djczaski June 24, 2015 06:14AM

Re: Nginx not logging to socket

Vladimir Homutov June 24, 2015 07:04AM

Re: Nginx not logging to socket

djczaski June 24, 2015 08:32AM

Re: Nginx not logging to socket

Vladimir Homutov June 24, 2015 10:02AM

Re: Nginx not logging to socket

djczaski June 24, 2015 10:22AM

Re: Nginx not logging to socket

Vladimir Homutov June 24, 2015 10:46AM

Re: Nginx not logging to socket

djczaski June 24, 2015 07:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
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