It states '''To activate this behavior, put the email addresses of the
recipients in the ADMINS setting.''' and in the following '''See also'''
it states that this behavior can be customized by changing logging.
The problem here is that a novice user will not easily catch that they
break this behavior if they add their own LOGGING into settings.py without
also adding the AdminEmailHandler handler and corresponding logger.
--
Ticket URL: <https://code.djangoproject.com/ticket/23784>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
I could see slightly improved wording being helpful, though it would be
nice to not increase the amount of text too much.
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:1>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:2>
* owner: nobody => gmunumel
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:3>
Comment (by pnovotnak):
Does "0001-updated-error-reporting-documentation-as-per-ticket-.patch"
work?
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:4>
Comment (by peterlauri):
Maybe include a direct link to the AdminEmailHandler as well as complement
to the reference to the logging configuration?
https://docs.djangoproject.com/en/1.7/topics/logging/#django.utils.log.AdminEmailHandler
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:5>
* owner: gmunumel =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:6>
* owner: => nschagen
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:7>
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/4268
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:8>
* status: assigned => closed
* has_patch: 1 => 0
* resolution: => invalid
Comment:
According to django/conf/global_settings.py, LOGGING is an empty
dictionary by default. There is also a DEFAULT_LOGGING in
django/utils/log.py, which is where the default admin emailing behaviour
is defined. DEFAULT_LOGGING and LOGGING are merged and therefore setting
your own LOGGING conf does not break the email to admin feature.
I have tested this by installing a FileHandler in both DEFAULT_LOGGING and
LOGGING and the message was written to both files.
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:9>
Comment (by peterlauri):
Replying to [comment:9 nschagen]:
> According to django/conf/global_settings.py, LOGGING is an empty
dictionary by default. There is also a DEFAULT_LOGGING in
django/utils/log.py, which is where the default admin emailing behaviour
is defined. DEFAULT_LOGGING and LOGGING are merged and therefore setting
your own LOGGING conf does not break the email to admin feature.
>
> I have tested this by installing a FileHandler in both DEFAULT_LOGGING
and LOGGING and the message was written to both files.
Yes, I have read that. And I was not expecting admin email behaviour to
break. But the below configuration breaks the admin email functionality, I
have a test case where DEBUG=False and emails stop being sent. Removing
the LOGGING completely OR re-adding makes it work again.
Can you share your LOGGING config?
{{{
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d
%(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'stream': sys.stdout,
'formatter': 'simple'
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO',
'propagate': True,
},
}
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:10>
Comment (by peterlauri):
You don't need to share your config, I get what you mean, had to read it
again :)
But still it remains unclear why the above LOGGING conf breaks the email
sending.
In my test case I use the in memory mail backend, and mails are not being
sent anymore using the above configuration.
--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:11>