Fixed #18993 -- 'django' logger logs to console when DEBUG=True

Thanks Preston Holmes for the review.
This commit is contained in:
Claude Paroz 2012-09-26 19:56:21 +02:00
parent a014ddfef2
commit f0f327bbfe
4 changed files with 71 additions and 18 deletions

View file

@ -172,6 +172,10 @@ Django 1.5 also includes several smaller improvements worth noting:
* An instance of :class:`~django.core.urlresolvers.ResolverMatch` is stored on
the request as ``resolver_match``.
* By default, all logging messages reaching the `django` logger when
:setting:`DEBUG` is `True` are sent to the console (unless you redefine the
logger in your :setting:`LOGGING` setting).
Backwards incompatible changes in 1.5
=====================================

View file

@ -546,6 +546,13 @@ logging module.
}
},
.. class:: RequireDebugTrue()
.. versionadded:: 1.5
This filter is similar to :class:`RequireDebugFalse`, except that records are
passed only when :setting:`DEBUG` is `True`.
.. _default-logging-configuration:
Django's default logging configuration
@ -555,5 +562,14 @@ By default, Django configures the ``django.request`` logger so that all messages
with ``ERROR`` or ``CRITICAL`` level are sent to :class:`AdminEmailHandler`, as
long as the :setting:`DEBUG` setting is set to ``False``.
All messages reaching the ``django`` catch-all logger are discarded
(sent to ``NullHandler``).
All messages reaching the ``django`` catch-all logger when :setting:`DEBUG` is
`True` are sent ot the console. They are simply discarded (sent to
``NullHandler``) when :setting:`DEBUG` is `False`.
.. versionchanged:: 1.5
Before Django 1.5, all messages reaching the ``django`` logger were
discarded, regardless of :setting:`DEBUG`.
See also :ref:`Configuring logging <configuring-logging>` to learn how you can
complement or replace this default logging configuration.