uWsgi Set Log Ownership Based on Process uid/gid

July 24, 2018
Avoid uWsgi write log as root
# logto = /var/log/uwsgi/app.log
logto2 = /var/log/uwsgi/app.log
uid = www-data
gid = www-data

To ensure the log ownership follow process’s uid and gid, use logto2 instead of logto.

logto2 only opens the log file after privileges have been dropped to the specified uid/gid.

NOTE: If logto is used, the log ownership is root.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.