Yes, you can access the traceback from the middleware.
Just call logger.exception() instead of something like logger.debug()
and you'll get the output in your log.
Here's my middleware:
import logging
logger = logging.getLogger(__name__)
class RequestExceptionMiddleware(object):
"""
Log any exceptions that happen in a view.
"""
def process_exception(self, request, exception):
logger.exception('view broke')
return None
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.