Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log only 5xx errors on uWSGI

Tags:

uwsgi

I want to let uWSGI only logging server errors and avoid the normal requests logs, because the file grow very fast, and all the requests logging does NGINX very well for me.

How can I properly configurate my uwsgi.ini for that? The documentation is not very clear for me.

like image 274
Antonio Romero Oca Avatar asked Feb 29 '16 07:02

Antonio Romero Oca


People also ask

What is uWSGI log?

Basic logging The most basic form of logging in uWSGI is writing requests, errors, and informational messages to stdout/stderr. This happens in the default configuration. The most basic form of log redirection is the --logto / --logto2 / --daemonize options which allow you to redirect logs to files.

What is harakiri in uWSGI?

harakiri. A feature of uWSGI that aborts workers that are serving requests for an excessively long time. Configured using the harakiri family of options. Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the corresponding worker recycled.

What is uWSGI params?

You can dynamically tune or configure various aspects of the uWSGI server using special variables passed by the web server (or in general by a uwsgi compliant client). For Nginx, the uwsgi_param <name> <value>; directive is used.


1 Answers

Finally the solution was quite simple:

logto = /var/log/uwsgi/uwsgi.log
log-5xx = true
disable-logging = true

According to the help:

-L|--disable-logging disable request logging

like image 82
Antonio Romero Oca Avatar answered Nov 10 '22 08:11

Antonio Romero Oca