From dc5b01ad05e50ccde688c73c2ed3334a956076b0 Mon Sep 17 00:00:00 2001 From: Caroline Simpson Date: Mon, 14 Apr 2014 17:18:03 -0400 Subject: 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. --- docs/releases/1.9.txt | 3 +++ docs/topics/logging.txt | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 4c27230d10..16a9e9d5f8 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -188,6 +188,9 @@ Templates * Added a :meth:`Context.setdefault() ` method. +* A warning will now be logged for missing context variables. These messages + will be logged to the :ref:`django.template ` logger. + Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt index 0e167871ab..89de6d56a4 100644 --- a/docs/topics/logging.txt +++ b/docs/topics/logging.txt @@ -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`` -- cgit v1.3