How to separate logs of uWSGI?

2019-05-02 00:21发布

问题:

I want to separate the logs of uwsgi like access logs, request logs, error logs in individual files. At the moment these all are in same file and not well formatted.

回答1:

There are configuration directives to specify different loggers for requests and all other messages: logger and req-logger. Example:

# uwsgi.ini
req-logger = file:/var/log/uwsgi/uwsgi-req.log
logger = file:/var/log/uwsgi/uwsgi.log

If you want nondefault formatting, filtering or a peculiar output location, you could write your own logging plugin. Here's a link the relevant page: http://uwsgi-docs.readthedocs.org/en/latest/Logging.html



标签: uwsgi