Hello everyone,
It's been a while since I last posted here, please forgive if I break any new rules inadvertently.
I'd like to revisit a decision made in [18993][]. My use case is very simple and obvious: I want all logging going into stdout.
As currently implemented, I can't do it easily with a custom `LOGGING` setting, because:
- If I leave existing Django loggers enabled it ties me to the behavior chosen by Django, which doesn't necessarily match what I want. For example, Django won't log debug and info messages if `DEBUG = False`. And with `DEBUG = True` I will be having two log messages for every log into the 'django' logger: one from the Django's own handler, and another after it propagates to my root logger.
- If I disable existing Django loggers, I effectively disable all logging from Django (and from 'py.warnings' for good measure).
In fact, the idea of providing a default logging configuration which a user can then *build upon* isn't really workable with Python logging: you can either fully reuse or fully discard what's been provided, but you can't meaningfully define a consistent configuration. Also, I have my doubts that this "build upon" use case is based on any real demand. In my experience there are only two approaches to configuring logging: "logging? huh, didn't think about it" and "get your hands off my logging, I know what I'm doing!"
The latter, incidentally, is what the old way was doing: define a sensible default value for `LOGGING` and let users to overwrite it completely. Currently, the default logging configuration is hard-coded in `django.utils.log`.
Also, I couldn't find the actual reasoning for the current behavior in the original ticket. It starts talking about having a more useful default, not about changing the way how this default configuration is applied.
[18993]:
https://code.djangoproject.com/ticket/18993