1👍
✅
For your logging configuration to be active, your settings have to be loaded. If you log in your settings file (or a module that is imported by it), your logging configuration is not yet loaded.
Have a look at django/__init__.py
:
...
from django.conf import settings
from django.utils.log import configure_logging
...
The statement LOGGING = ...
in your settings file doesn’t actually configure the logging system. The configuration of the logging happens after the settings have been loaded.
You could configure logging manually in your settings file by directly using the logging
module, but I would suggest you first evaluate if you really need to log in your settings file.
Source:stackexchange.com