I have a python 2 flask app running behind uWSGI, which is managed by supervisord. Logs are being written to sys.stdout by the flask app. These logs are then picked up by uWSGI and written to file by supervisord. uWSGI logs are written to /dev/stderr. See the supervisord conf below.
[program:uwsgi]
command = uwsgi --ini /etc/uwsgi.conf --master
directory = /app
autostart = true
autorestart = true
stdout_logfile = /var/log/myapplication/application.log
stdout_logfile_maxbytes = 50000000
stdout_logfile_backups = 3
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
stopsignal = INT
This works great! I have nicely separated application logs and uWSGI logs.
I've now upgraded to python 3. This has all gone fine, except the application logs are now ending up in uWSGI's stderr, mixed in with the uWSGI logs.
I've trawled the uWSGI docks, and have not been able to find a reason for this change between python 2 and python 3.
I've tried redirecting when defining the socket, like is suggested here http://lists.unbit.it/pipermail/uwsgi/2016-February/008383.html but that just redirects everything (application and uWSGI logs) to /dev/null.
I also found this http://lists.unbit.it/pipermail/uwsgi/2016-January/008353.html but could't find anything about pyimport-shared.
Does anyone know what might be going on?
My uWSGI conf is here if it help.
[uwsgi]
uid = www-data
gid = www-data
module = application:application
socket = /run/uwsgi.sock
single-interpreter = true
enable-threads = true
buffer-size = 16384
processes = 4
Thanks