I have a setup where the settings.py is shared by:
- A django server running multiple processes with pyuwsgi
- A celery app which sets the DJANGO_SETTINGS_MODULE to configure celery app
- A handful of periodic & manually run jobs which invoke manage.py
The LOGGING configuration is then shared by each of these, which includes the logfile name. This seems to me to result in the bad situation described in the python logging-cookbook where multiple unrelated processes are logging to the same file.
How should one configure separate files for each of these processes? Ideally I could see something as simple as naming the file differently based upon each “main”, but I can’t seem to figure a clean way to detect which processes is importing the settings.py.