How to enable uWSGI logging to a file?

后端 未结 2 1866
盖世英雄少女心
盖世英雄少女心 2021-01-04 06:10

I have just installed my first uWSGI server on EC2 Ubuntu 14.04 LTS, using the following configuration:

[uwsgi]
http-         


        
相关标签:
2条回答
  • 2021-01-04 06:39

    The "common" syntax is "logto = file".

    The logger option is used for advanced plugins, if you want to use the 'file' one you have to load the logfile plugin (like you load the python one). But honestly if you only want to log to a file, logto will be more than enough

    0 讨论(0)
  • 2021-01-04 06:43

    The accepted answer did not work for me (possibly because it is 4 years old). Nginx running uwsgi 2.0.17.1 in a virtual env with circus controlling the workers. This did work though:

    req-logger = file:/var/log/uwsgi/app/cart-req.log
    logger = file:/var/log/uwsgi/app/cart-err.log
    

    Not sure if it was necessary, but I

    $ chmod -R www-data:www-data /var/log/uwsgi/app
    

    ref: https://uwsgi-docs.readthedocs.io/en/latest/Logging.html

    as uwsgi runs as www-data

    0 讨论(0)
提交回复
热议问题