forked from django-auth-ldap/django-auth-ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document logging use Django's LOGGING setting
- Loading branch information
Showing
1 changed file
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | ||
}, | ||
}, | ||
} |