#18993: Default django logging to StreamHandler (when DEBUG=True)
------------------------------+--------------------------------------
     Reporter:  claudep       |                    Owner:  nobody
         Type:  New feature   |                   Status:  new
    Component:  Core (Other)  |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  1             |      Needs documentation:  1
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by claudep):

 After some thinking, I think there is a small flaw in the current Django
 logging config system. The LOGGING config in global_settings.py is
 overriden by any custom settings LOGGING. When we update LOGGING in
 global_settings, any upgraded project cannot take advantage of newer
 features in the LOGGING config.

 My proposal would be:
 * Add DEFAULT_LOGGING in global_settings.py (with current LOGGING as
 content). This is *not* supposed to be overriden by project's settings.py
 (we can even imagine put it somewhere else, django.utils.log comes to
 mind). By default, global_settings.py LOGGING would be empty. We can still
 let the current content in project template LOGGING.
 * When configuring LOGGING (`django.conf.__init__.py`), first feed
 DEFAULT_LOGGING to the config function, then, if LOGGING is not empty,
 feed LOGGING to the config system.

 Here are the possible scenarios:
 * If the user has set `disable_existing_loggers` to True in his project's
 LOGGING, nothing has changed for him. He's still in complete control of
 logging in his project.
 * If the user has no LOGGING in his settings, the situation is unchanged,
 Django default logging is configured.
 * If the user has set `disable_existing_loggers` to False in LOGGING
 (which is currently the default in the project template), then Django
 default logging is configured, and the user custom LOGGING is *added* to
 the Django default configuration.

 This latest point is where we really gain from the current situation. We
 don't have to fiddle any more with the logging setup code.

 I may be missing something in my reasoning. Comments welcome!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18993#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to