[Django] #24361: The doc is not right w.r.t. LOGGING overwriting.

11 views
Skip to first unread message

Django

unread,
Feb 17, 2015, 6:20:40 PM2/17/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+--------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
The https://github.com/django/django/blob/master/docs/topics/logging.txt
says

If the `disable_existing_loggers` key in the :setting:`LOGGING`
dictConfig is set to `True` (which is the default) the default
configuration is completely overridden.

That is **not right** and it is pretty painful to trace down that the
`django.request` and `django.security`, although disabled, don't propagate
to the root logger even when `disable_existing_loggers` in my LOGGING is
`True`. One would expect the disabling would allow the logger to propagate
again.

Many people apparently already ran into this.

There are Stack Overflow questions and blog posts about this topic. Best
of them I found is here: http://www.caktusgroup.com/blog/2015/01/27
/Django-Logging-Configuration-logging_config-default-settings-logger/

It suggests the working way to put to `settings` to **really erase the
default logging**. I think it should definitely be stated in the doc.

{{{
LOGGING_CONFIG = None
LOGGING = {...} # whatever you want

import logging.config
logging.config.dictConfig(LOGGING)
}}}

The logging system is complex by itself, something it is not a pleasure to
work with for many. The reset path eliminating the confusion would be most
welcome.

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

Django

unread,
Feb 17, 2015, 6:36:01 PM2/17/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* easy: 1 => 0
* stage: Unreviewed => Accepted


Comment:

I'll be happy to review any patch you could draft. See also #23394 and
#23784.

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:1>

Django

unread,
Feb 18, 2015, 5:55:46 AM2/18/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tuttle):

Thank you. Sending a draft.

(Sorry, if the markup is wrong. ReST can compete with the logging module
in opacity...)

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:2>

Django

unread,
Feb 18, 2015, 8:05:09 AM2/18/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tuttle):

There is a neat module `logging_tree` by Brandon Rhodes on PyPi that can
be of tremendous help during understanding of the actual logger tree.

I don't know whether it could be considered to merge the module to Django,
but what if I send a patch mentionting this module in the `logging.txt`
doc?

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:3>

Django

unread,
Mar 7, 2015, 12:28:52 PM3/7/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:4>

Django

unread,
Mar 21, 2015, 2:27:08 PM3/21/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by timgraham):

I lightly edited your patch and
[https://github.com/django/django/pull/4362 created a pull request] so
others can offer their thoughts. I also [https://groups.google.com/d/topic
/django-developers/no2IhnRty68/discussion posted to django-developers] to
see if we can improve the state of logging in Django more generally.

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:5>

Django

unread,
Mar 22, 2015, 9:08:38 AM3/22/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------------+-------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by phalt):

* stage: Accepted => Ready for checkin


Comment:

Looks good and makes sense.

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:6>

Django

unread,
Mar 23, 2015, 10:09:34 AM3/23/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* stage: Ready for checkin => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:7>

Django

unread,
Mar 24, 2015, 12:26:24 PM3/24/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"c633667da3605208ea5fc137f5322c599f48da69" c633667d]:
{{{
#!CommitTicketReference repository=""
revision="c633667da3605208ea5fc137f5322c599f48da69"
Fixed #24361 -- Clarified docs on reconfiguring logging.

Thanks Tuttle for the report and draft patch, and Carl Meyer for
help and review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:8>

Django

unread,
Mar 24, 2015, 12:26:40 PM3/24/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0dc986d1c8a3bfc7d9afdf9a8c28f39aaa101aac" 0dc986d1]:
{{{
#!CommitTicketReference repository=""
revision="0dc986d1c8a3bfc7d9afdf9a8c28f39aaa101aac"
[1.8.x] Fixed #24361 -- Clarified docs on reconfiguring logging.

Thanks Tuttle for the report and draft patch, and Carl Meyer for
help and review.

Backport of c633667da3605208ea5fc137f5322c599f48da69 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:9>

Django

unread,
Mar 24, 2015, 12:26:41 PM3/24/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0121fb814807763541245b3c131ccace3f18ac0e" 0121fb81]:
{{{
#!CommitTicketReference repository=""
revision="0121fb814807763541245b3c131ccace3f18ac0e"
[1.7.x] Fixed #24361 -- Clarified docs on reconfiguring logging.

Thanks Tuttle for the report and draft patch, and Carl Meyer for
help and review.

Backport of c633667da3605208ea5fc137f5322c599f48da69 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:10>

Django

unread,
Sep 23, 2015, 11:22:33 AM9/23/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"4a06a904dcd27388ec9a3cfb2bc8a8421bb44816" 4a06a90]:
{{{
#!CommitTicketReference repository=""
revision="4a06a904dcd27388ec9a3cfb2bc8a8421bb44816"
Refs #24361 -- Corrected documented level of the 'django' logger.

The logger doesn't define an explicit level, therefore it defaults
to WARNING.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:11>

Django

unread,
Sep 23, 2015, 11:23:01 AM9/23/15
to django-...@googlegroups.com
#24361: The doc is not right w.r.t. LOGGING overwriting.
-------------------------------+------------------------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"8f42934f86c1c6dff9fb24fd6fadb9d72b89d7b6" 8f42934f]:
{{{
#!CommitTicketReference repository=""
revision="8f42934f86c1c6dff9fb24fd6fadb9d72b89d7b6"
[1.7.x] Refs #24361 -- Corrected documented level of the 'django' logger.

The logger doesn't define an explicit level, therefore it defaults
to WARNING.

Backport of 4a06a904dcd27388ec9a3cfb2bc8a8421bb44816 from stable/1.8.x
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24361#comment:12>

Reply all
Reply to author
Forward
0 new messages