Fixed #18773 -- Added logging for template variable resolving

Added a django.template logger without a default handler. Added
logging if there is an exception while resolving variables in a
template.
This commit is contained in:
Caroline Simpson 2014-04-14 17:18:03 -04:00 committed by Tim Graham
parent 0c91a419f8
commit dc5b01ad05
6 changed files with 93 additions and 0 deletions

View file

@ -188,6 +188,9 @@ Templates
* Added a :meth:`Context.setdefault() <django.template.Context.setdefault>`
method.
* A warning will now be logged for missing context variables. These messages
will be logged to the :ref:`django.template <django-template-logger>` logger.
Requests and Responses
^^^^^^^^^^^^^^^^^^^^^^

View file

@ -478,6 +478,16 @@ Messages to this logger have the following extra context:
* ``request``: The request object that generated the logging
message.
.. _django-template-logger:
``django.template``
~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.9
Log messages related to the rendering of templates. Missing context variables
are logged as ``DEBUG`` messages if :setting:`DEBUG` is `True`.
.. _django-db-logger:
``django.db.backends``