Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #20844 -- Made AdminEmailHandler respect LOGGING 'formatter' se…

…tting.
  • Loading branch information...
commit ad6fcdb8d24d84a130f847f45b51d7e892ccca08 1 parent 9451d8d
Daniel Sokolowski authored timgraham committed
Showing with 3 additions and 5 deletions.
  1. +3 −5 django/utils/log.py
View
8 django/utils/log.py
@@ -84,24 +84,22 @@ def emit(self, record):
record.getMessage()
)
filter = get_exception_reporter_filter(request)
- request_repr = filter.get_request_repr(request)
+ request_repr = '\n{0}'.format(filter.get_request_repr(request))
except Exception:
subject = '%s: %s' % (
record.levelname,
record.getMessage()
)
request = None
- request_repr = "Request repr() unavailable."
+ request_repr = "unavailable"
subject = self.format_subject(subject)
if record.exc_info:
exc_info = record.exc_info
- stack_trace = '\n'.join(traceback.format_exception(*record.exc_info))
else:
exc_info = (None, record.getMessage(), None)
- stack_trace = 'No stack trace available'
- message = "%s\n\n%s" % (stack_trace, request_repr)
+ message = "%s\n\nRequest repr(): %s" % (self.format(record), request_repr)
reporter = ExceptionReporter(request, is_email=True, *exc_info)
html_message = reporter.get_traceback_html() if self.include_html else None
mail.mail_admins(subject, message, fail_silently=True,
Please sign in to comment.
Something went wrong with that request. Please try again.