Using Django 1.5.1:
DEBUG = False
LOGGING = {
\'version\': 1,
\'disable_existing_loggers\': True,
\'formatters\': {
\'verbose\': {
Ok, so the behavior is "correct", but not expected. django/conf/__init__.py:65
:
def _configure_logging(self):
...
if self.LOGGING_CONFIG:
from django.utils.log import DEFAULT_LOGGING
# First find the logging configuration function ...
logging_config_path, logging_config_func_name = self.LOGGING_CONFIG.rsplit('.', 1)
logging_config_module = importlib.import_module(logging_config_path)
logging_config_func = getattr(logging_config_module, logging_config_func_name)
logging_config_func(DEFAULT_LOGGING)
if self.LOGGING:
# Backwards-compatibility shim for #16288 fix
compat_patch_logging_config(self.LOGGING)
# ... then invoke it with the logging settings
logging_config_func(self.LOGGING)
What is happening is that default logging configuration is applied and django.request
logger is created. Then my custom LOGGING
configuration is applied with disable_existing_loggers = True
, but Python doesn't delete already existing logger django.request
, but only disables it.
So I have to manually reconfigure django.request
logger in my configuration. :(