Search code examples
logginguwsgiini

How to enable uWSGI logging to a file?


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

[uwsgi]
http-socket    = :9001
plugin    = python
wsgi-file = foo.wsgi
chdir = /home/bar
process   = 3

The uWSGI container works fine, but has no logging. Following the manual, I've added the following:

logger = file:/tmp/errlog

But restarting (using sudo service uwsgi restart) did not work - the server would not start with this configuration.

Any idea what's missing from my ini configuration?


Solution

  • 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