-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
This is a bit misleading: http://readthedocs.org/docs/sentry/en/latest/config/index.html#integration-with-logging
due to the problem described in this comment: https://github.com/dcramer/django-sentry/issues/193#issuecomment-1584249
In Django 1.3 we have the following:
https://code.djangoproject.com/browser/django/tags/releases/1.3/django/core/handlers/base.py#L152
https://code.djangoproject.com/browser/django/tags/releases/1.3/django/core/handlers/base.py#L166
https://code.djangoproject.com/browser/django/tags/releases/1.3/django/core/handlers/base.py#L180
- as you can see, signals.got_request_exception.send() is always paired with handle_uncaught_exception(). And the latter function logs the caught exception:
https://code.djangoproject.com/browser/django/tags/releases/1.3/django/core/handlers/base.py#L205
And because django-sentry wires itself to signals.got_request_exception():
https://github.com/dcramer/django-sentry/blob/master/sentry/client/models.py#L61
- if one adds SentryHandler to one of django.request, django or root loggers, the exception is logged twice.
Now, this is not the end of the world, but would be good to fix, e.g. by adding configuration option to prevend django-sentry from wiring to signals.got_request_exception.send().
I will prepare a patch (unless someone else is quicker or eager to do that :)) but some short discussion on this would be great to have first - maybe I overlooked a solution or a better approach exists.