On 03/23/2015 11:48 AM, Tim Graham wrote:
> The alternative to a new setting would be to revert the "merging"
> behavior of the django.utils.log.DEFAULT_LOGGING and settings.LOGGING
> entirely. This original design was proposed by Claude in
> https://code.djangoproject.com/ticket/18993#comment:7, but now we
> realize disable_existing_loggers=True doesn't work as expected in that
> proposal. I also find that writing a nice configuration that uses
> disable_existing_loggers=False and that merges nicely with Django's
> defaults to be difficult (for example, in trying to output all log
> entries to the console, some as simple as the config below [1] won't
> work because Django's DEFAULT_LOGGING has handlers for 'django.request'
> and 'django.security' which don't propagate their entries (I couldn't
> tell the reason for this from
> https://github.com/django/django/commit/f0f327bbfe1caae6d11fbe20a3b5b96eed1704cf#diff-246800ac266982b8ad12f505352a662eR63)

I'm also not clear why 'django.security' and 'django.request' should
have `propagate: False`. Seems to me we should maybe just remove that?
Does anyone know why it's there?

If we removed the `propagate: False` from those two loggers, then I
think it would be a lot more feasible to get sane behavior by layering
additional config atop the default config. It seems useful to continue
to support that approach as an option, for people who want "defaults
plus", and want to get any future updates to the default config
automatically.

ISTM that "layer atop the default config" is a better default behavior
if you add a LOGGING setting than "replace the default config", to avoid
people losing their mail-admins config accidentally. (But we definitely
need first-class support for "replace the default config" as an option,
too.)

> I would like to ask if anyone who is using settings.LOGGING could share
> their config so we can get a sense of different use cases?

For my personal use cases, I wouldn't have a problem with reverting the
merged-config approach. The default logging config consists of
mail-admins (I use Sentry instead) and a console handler for 'django.*'
(which I replace with a root console handler in dev). And I also read
release notes, so if there were future changes to the default logging
config that I might want to adopt in my own config, I'm confident I'd
see them.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/55105910.4020909%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to