Skip to content

Commit

Permalink
Document logging use Django's LOGGING setting
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck authored and jdufresne committed Jul 12, 2018
1 parent 675d690 commit 5c3fbdc
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions docs/logging.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Logging
=======

:class:`~django_auth_ldap.backend.LDAPBackend` uses the standard logging module
to log debug and warning messages to the logger named ``'django_auth_ldap'``. If
you need debug messages to help with configuration issues, you should add a
handler to this logger. Note that this logger is initialized with a level of
NOTSET, so you may need to change the level of the logger in order to get debug
messages.
:class:`~django_auth_ldap.backend.LDAPBackend` uses the standard Python
:mod:`logging` module to log debug and warning messages to the logger named
``'django_auth_ldap'``. If you need debug messages to help with configuration
issues, you should add a handler to this logger. Using Django's
:setting:`LOGGING` setting, you can add an entry to your config.

.. code-block:: python
import logging
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
LOGGING = {
'loggers': {
'django_auth_ldap': {
'level': 'DEBUG',
'handlers': ['console'],
},
},
}

0 comments on commit 5c3fbdc

Please sign in to comment.