#29714: Option to hide cookies in error reports
-------------------------------------+-------------------------------------
Reporter: Vasili Korol | Owner: (none)
Type: New feature | Status: closed
Component: Error reporting | Version: master
Severity: Normal | Resolution: wontfix
Keywords: email, reports, | Triage Stage:
cookies | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michael Manfre):
{{{ExceptionReporter}}} is used by
{{{django.utils.log.AdminEmailHandler}}}. To fully replace
{{{ExceptionReporter}}},
it's necessary to replace the "mail_admins" LOGGING handler to use a
different one that uses the reporter you define.
{{{
LOGGING = {..., 'handlers': {
...
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'myproject.log.MySafeAdminEmailHandler'
}
}}
}}}
The easiest way is to override {{{AdminEmailHandler}}} would be to
override {{{emit()}}} with a copy that replaces
{{{ExceptionReporter}}}. That's a lot of copy & pasted code to swap out a
class used in a single line. I feel we should
make that part of the process a bit friendlier. Maybe ending up so Vasili
and others could do the below:
{{{
class MySafeAdminEmailHandler(AdminEmailHandler):
def __init__(self):
super().__init__(exception_reporter=SafeExceptionReporter)
}}}
OR
{{{
class MySafeAdminEmailHandler(AdminEmailHandler):
exception_reporter=SafeExceptionReporter
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29714#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.c08f2b8952d70efe8b7de299fcb591a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.