uWsgi Set Log Ownership Based on Process uid/gid

Jul 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.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.