Browse files

Fixed #14861 -- Added an admonition about the potential for circular …

…imports with custom logging handlers (which produces an extremely confusing error message) to the logging docs. Thanks to donspaulding for the report and adamv for the patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
Gabriel Hurley
Gabriel Hurley committed Feb 7, 2011
1 parent f80e997 commit 66312066a01af1325280b07d8e6942b03a46d650
Showing with 30 additions and 0 deletions.
  1. +30 −0 docs/topics/logging.txt
@@ -349,6 +349,36 @@ This logging configuration does the following things:
printed to the console; ``ERROR`` and ``CRITICAL``
messages will also be output via e-mail.
.. admonition:: Custom handlers and circular imports
If your ```` specifies a custom handler class and the file
defining that class also imports ```` a circular import will
For example, if ```` contains the following config for
'version': 1,
'handlers': {
'custom_handler': {
'level': 'INFO',
'class': 'myproject.logconfig.MyHandler',
and ``myproject/`` has the following line before the
``MyHandler`` definition::
from django.conf import settings
then the ``dictconfig`` module will raise an exception like the following::
ValueError: Unable to configure handler 'custom_handler':
Unable to configure handler 'custom_handler':
'module' object has no attribute 'logconfig'
.. _formatter documentation:
Custom logging configuration

0 comments on commit 6631206

Please sign in to comment.