overriding handle_uncaught_exception to get a stack trace

31 views
Skip to first unread message

Boris Raskin

unread,
Jun 11, 2011, 12:37:49 AM6/11/11
to django...@googlegroups.com
Howdy,

I am trying to keep track of the 500 errors that I get on my production site. I realize that outside of DEBUG mode Django will email admins when it hits 500 errors. This might get a little overwhelming if the same error occurs a bunch of times. I am hoping to find a way that will let me put these into a log file or do something more creative than just getting them by email so that I can keep track of them.

I believe handle_uncaught_exception in django.core.handlers.base is responsible for dealing with uncaught exceptions.

What is the best way to override it?

Boris.

bruno desthuilliers

unread,
Jun 11, 2011, 10:02:18 AM6/11/11
to Django users
On 11 juin, 06:37, Boris Raskin <bras...@playdation.net> wrote:
> Howdy,
>
> I am trying to keep track of the 500 errors that I get on my production
> site. I realize that outside of DEBUG mode Django will email admins when it
> hits 500 errors. This might get a little overwhelming if the same error
> occurs a bunch of times. I am hoping to find a way that will let me put
> these into a log file or do something more creative than just getting them
> by email so that I can keep track of them.

https://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception
https://docs.djangoproject.com/en/1.3/topics/logging/
http://docs.python.org/library/logging.html

Reply all
Reply to author
Forward
0 new messages