Yuri Heupa
Yuri Heupa

Reputation: 1248

UWSGI not logging to my logto/daemonize specified file

I'm trying to set my uwsgi config to log to specific file, but it seems not be working, I figured that when uwsgi starts it runs this command:

/usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/notescor.com.ini --daemonize /var/log/uwsgi/app/notescor.com.log

This is my .ini file on apps-enabled folder:

[uwsgi]

chdir           = /srv/notescor.com/www/src
pythonpath      = /var/www/.virtualenvs/notescor.com/lib/python2.7/site-packages
env             = DJANGO_SETTINGS_MODULE=settings
module          = django.core.wsgi:get_wsgi_application()
logto           = /srv/notescor.com/log/uwsgi/uwsgi.log
daemonize       = /srv/notescor.com/log/uwsgi/uwsgi.log

no-site         = true
master          = true
workers         = 16
socket          = /run/uwsgi/app/notescor.com/socket
chmod-socket    = 664
vacuum          = true

Looks like my ini log config is getting ignored and the command is overriding it to /srv/notescor.com/log/uwsgi/uwsgi.log. ps. the /srv/notescor.com/log/uwsgi folder has www-data:www-data permissions, which is where my uwsgi runs

Upvotes: 4

Views: 1942

Answers (1)

Ahmed AbouZaid
Ahmed AbouZaid

Reputation: 2918

This is managed by uwsgi init functions which are shipped with uwsgi package.

You can find it in this path in Ubuntu /usr/share/uwsgi/init/specific_daemon:

--"${CONFFILE_OPTION_NAME}" "${CONFFILE}" \

--daemonize "/var/log/uwsgi/${CONFNAMESPACE}/${CONFNAME}.log" \


Should be like this to overtire daemonize option with ini file.

--daemonize "/var/log/uwsgi/${CONFNAMESPACE}/${CONFNAME}.log" \

--"${CONFFILE_OPTION_NAME}" "${CONFFILE}" \


So simply edit this file (or manage it if you are using CM tools).

Or a better solution is to get rid of all this, and use a process control system like Supervisord :-)

Upvotes: 1

Related Questions