mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #19325 - Made email backend of AdminEmailHandler configurable
This commit is contained in:
parent
1f1f60d12f
commit
f9891f2087
5 changed files with 69 additions and 3 deletions
|
@ -440,7 +440,7 @@ Handlers
|
|||
Django provides one log handler in addition to those provided by the
|
||||
Python logging module.
|
||||
|
||||
.. class:: AdminEmailHandler([include_html=False])
|
||||
.. class:: AdminEmailHandler(include_html=False, email_backend=None)
|
||||
|
||||
This handler sends an email to the site admins for each log
|
||||
message it receives.
|
||||
|
@ -476,6 +476,23 @@ Python logging module.
|
|||
sensitive information to be filtered out of error reports -- learn more on
|
||||
:ref:`Filtering error reports<filtering-error-reports>`.
|
||||
|
||||
.. versionadded:: 1.5
|
||||
|
||||
By setting the ``email_backend`` argument of ``AdminEmailHandler``, the
|
||||
:ref:`email backend <topic-email-backends>` that is being used by the
|
||||
handler can be overridden, like this::
|
||||
|
||||
'handlers': {
|
||||
'mail_admins': {
|
||||
'level': 'ERROR',
|
||||
'class': 'django.utils.log.AdminEmailHandler',
|
||||
'email_backend': 'django.core.mail.backends.filebased.EmailBackend',
|
||||
}
|
||||
},
|
||||
|
||||
By default, an instance of the email backend specified in
|
||||
:setting:`EMAIL_BACKEND` will be used.
|
||||
|
||||
.. _Sentry: http://pypi.python.org/pypi/sentry
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue