summaryrefslogtreecommitdiff
path: root/docs/topics/logging.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2011-03-16 04:13:57 +0000
committerAdrian Holovaty <adrian@holovaty.com>2011-03-16 04:13:57 +0000
commit304a50d8cac1d185685d212867a2d449c5378e9e (patch)
tree6c34bbec041bec75e3e957a8ce3438600b39f652 /docs/topics/logging.txt
parent2ee7cfcf1c671681e46b685f268797d175ecff20 (diff)
Fixed #15603 -- Changed the traceback error e-mails not to use HTML by default. It's now configurable with an 'include_html' parameter to AdminEmailHandler. Thanks, kmtracey
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/logging.txt')
-rw-r--r--docs/topics/logging.txt29
1 files changed, 27 insertions, 2 deletions
diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt
index 618decdd70..309ea364b4 100644
--- a/docs/topics/logging.txt
+++ b/docs/topics/logging.txt
@@ -468,13 +468,38 @@ Handlers
Django provides one log handler in addition to those provided by the
Python logging module.
-.. class:: AdminEmailHandler()
+.. class:: AdminEmailHandler([include_html=False])
This handler sends an e-mail to the site admins for each log
message it receives.
- If the log record contains a 'request' attribute, the full details
+ If the log record contains a ``request`` attribute, the full details
of the request will be included in the e-mail.
If the log record contains stack trace information, that stack
trace will be included in the e-mail.
+
+ The ``include_html`` argument of ``AdminEmailHandler`` is used to
+ control whether the traceback e-mail includes an HTML attachment
+ containing the full content of the debug Web page that would have been
+ produced if ``DEBUG`` were ``True``. To set this value in your
+ configuration, include it in the handler definition for
+ ``django.utils.log.AdminEmailHandler``, like this::
+
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'class': 'django.utils.log.AdminEmailHandler',
+ 'include_html': True,
+ }
+ },
+
+ Note that this HTML version of the e-mail contains a full traceback,
+ with names and values of local variables at each level of the stack, plus
+ the values of your Django settings. This information is potentially very
+ sensitive, and you may not want to send it over e-mail. Consider using
+ something such as `django-sentry`_ to get the best of both worlds -- the
+ rich information of full tracebacks plus the security of *not* sending the
+ information over e-mail.
+
+.. _django-sentry: http://pypi.python.org/pypi/django-sentry