[Django] #23784: Error reporting docs needs to state clearly that changing logging conf error emails are not sent out unless configuring it again

28 views
Skip to first unread message

Django

unread,
Nov 9, 2014, 11:17:30 AM11/9/14
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
-------------------------------+--------------------
Reporter: peterlauri | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
Related documentation: https://docs.djangoproject.com/en/1.7/howto/error-
reporting/

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.

Django

unread,
Nov 13, 2014, 12:22:23 PM11/13/14
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
-------------------------------+------------------------------------

Reporter: peterlauri | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by collinanderson):

* 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>

Django

unread,
Jan 29, 2015, 2:36:38 PM1/29/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* type: Uncategorized => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:2>

Django

unread,
Feb 26, 2015, 4:26:59 PM2/26/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: gmunumel
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by gmunumel):

* owner: nobody => gmunumel
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:3>

Django

unread,
Mar 3, 2015, 12:51:24 AM3/3/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: gmunumel
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by pnovotnak):

Does "0001-updated-error-reporting-documentation-as-per-ticket-.patch"
work?

--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:4>

Django

unread,
Mar 3, 2015, 9:20:45 AM3/3/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: gmunumel
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Django

unread,
Mar 5, 2015, 3:16:02 AM3/5/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner:
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by gmunumel):

* owner: gmunumel =>
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:6>

Django

unread,
Mar 7, 2015, 9:22:07 AM3/7/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nschagen
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by nschagen):

* owner: => nschagen


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:7>

Django

unread,
Mar 7, 2015, 12:04:47 PM3/7/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nschagen
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by nschagen):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/4268

--
Ticket URL: <https://code.djangoproject.com/ticket/23784#comment:8>

Django

unread,
Mar 7, 2015, 2:38:43 PM3/7/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nschagen
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by nschagen):

* 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>

Django

unread,
Mar 7, 2015, 3:47:25 PM3/7/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nschagen
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Django

unread,
Mar 7, 2015, 3:57:36 PM3/7/15
to django-...@googlegroups.com
#23784: Error reporting docs needs to state clearly that changing logging conf
error emails are not sent out unless configuring it again
--------------------------------------+------------------------------------
Reporter: peterlauri | Owner: nschagen
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages