Normally the django 'mail_admins' logging handler will email you 500 errors to ADMINS along with a useful stacktrace of what happened.
But for some reason I'm getting error emails with
Request repr() unavailable
at the bottom of the email! Anyone know how to figure out why this is happening? (So I can get stacktraces to fix bugs with!)
Although it is a question long time ago, the answer here might help others in the future. It's important to pass in request through extra.
logger = logging.getLogger(__name__)
logger.error(
logging.traceback.format_exc(),
extra={
'status_code': 500, # or else
'request': request
}
)