Django log file permissions with uwsgi

I am using Django with uwsgi. The process runs as the user www-data

who also owns all the log files (for both uwsgi and Django). When I use RotatingFileHandler to log into Django, new log files are created with the following permissions:

-rw-r--r-- 1 www-data www-data

      

I added the logged in user ( ubuntu

) to the www-data

group, but still does not have write access to the specified log files. As a result, I cannot start python manage.py test

.

How can I tell (i) uwsgi or (ii) the framework of registration or (iii) file handler to create log files with permissions 0660

to both ubuntu

and www-data

can read / write to the log file.

However, there is a caveat, if I run manage.py test

and the lottery happens at this point, the new log file will be owned by the user ubuntu

and uwsgi will complain. I don't know if it is possible to fix this by changing the existing user / group rights structure.

+3


source to share


1 answer


I think you need to implement your own subclass as shown in this SO



0


source







All Articles