[uWSGI] daemonize and log file

Roberto De Ioris roberto at unbit.it
Fri Oct 11 21:57:22 CEST 2013

> Hi all,
> I write you for a little question regarding a great framework (I continue
> to discover new and usefull features in uWSGI!)
> I'm using uWSGI with --logger option to send any log tu syslog
> Now I want to daemonize the uwsgi process so I use the --daemonize option
> The daemonize option requests a <logfile> argument and I can't specify
> syslog, but only a file or a udp socket

yes, because technically the argument of the daemonize option is what you
want to do with the file descriptors 1 and 2 (stdout and stderr)

You could set it as /dev/null, but honestly i always suggest to have it
pointing to a real file so if there is something wrong before the syslog
system is setup you will have a fallback to that file.

> So, in my case, I have to specify both options: logger and daemonize
> Now the questions...
> What's the role of the logfile specified in the daemonize option?
> I find it is 0 bytes
> Will it never contain any message?
> Do you think it is correct that I put it in the same directory with
> pid-file and sock-file (/var/run/uwsgi on centos)?

well, i tend to not enforce any path convention (it is the role of
packagers), but /var/run i so generic (in modern times) that i would not
find it wrong to store the 'emergency' log in it.


Roberto De Ioris

More information about the uWSGI mailing list