Welcome! Log In Create A New Profile

Advanced

Re: error logging with nginx and uWSGI

Maxim Dounin
May 05, 2015 10:04AM
Hello!

On Tue, May 05, 2015 at 08:08:42AM -0400, Larry Martell wrote:

> On Sun, May 3, 2015 at 8:18 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> > Hello!
> >
> > On Fri, May 01, 2015 at 12:04:51PM -0400, Larry Martell wrote:
> >
> >> Prior to now, all the django projects I've worked on have used apache
> >> and WSGI. With those, when an error occurred I went to
> >> /var/log/httpd/error_log and details of the error were clearly there.
> >>
> >> Now for the first time I am working on a project using nginx and
> >> uWSGI. Here, the /var/log/nginx/error_log is always empty. And the
> >> uWSGI logs have some messages, but nothing about any errors. In this
> >> setup where would I go to find the errors that
> >> /var/log/httpd/error_log logs? Is there some config setting that is
> >> suppressing the nginx errors?
> >
> > The uwsgi protocol doesn't include an error stream from an
> > application to nginx. That is, if you are looking for errors
> > generated by your application, you should look into uWSGI logs.
> >
> > Own nginx logs can be controlled using the error_log directive,
> > see http://nginx.org/r/error_log. But I suspect it's not what are
> > you looking for, see above.
>
> When my app has, for example, a syntax error, then yes, that appears
> in the uWSGI log. But what I was talking about are the HTTP errors
> like a 500 or a 400. When I get those there's nothing in the logs.

If an error is returned by your application and/or uWSGI, then its
reasons are expected to be in your application logs (or the uWSGI
logs).

If an error is returned by nginx (e.g., because a client sent an
invalid request and nginx returned 400), then reasons should be in
nginx error log. Client-related errors, though, are usually
logged at the "info" level, and won't be visible in error log by
default, see http://nginx.org/r/error_log.

Note well that nginx error logs are highly customizeable, and it
is possible that you are looking into a wrong file. In
particular, please note that default error log can be redefined
during compilation (see "nginx -V" output to find out which one is
used by default), and can also be redefined on a per-server or a
per-location basis (check your configs to find out if it's the
case).

--
Maxim Dounin
http://nginx.org/

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

error logging with nginx and uWSGI

Larry Martell May 01, 2015 12:06PM

Re: error logging with nginx and uWSGI

Maxim Dounin May 03, 2015 08:20AM

Re: error logging with nginx and uWSGI

Larry Martell May 05, 2015 08:10AM

Re: error logging with nginx and uWSGI

Maxim Dounin May 05, 2015 10:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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