diff --git a/django/utils/log.py b/django/utils/log.py index 763e667c57..4fb75b1504 100644 --- a/django/utils/log.py +++ b/django/utils/log.py @@ -79,7 +79,11 @@ class AdminEmailHandler(logging.Handler): ) request_repr = repr(request) except: - subject = 'Error: Unknown URL' + subject = '%s: %s' % ( + record.levelname, + record.msg + ) + request = None request_repr = "Request repr() unavailable"