Sentry handler in LOGGING config doesn't respect filters #289
Comments
By default Sentry does not rely on logging. Whats likely happening is that Django bubbles up these SuspiciousOperation errors, and Sentry hooks into the core Django handler so that it still captures these. I would simply recommend doing a try/except on them (possibly in a middleware?) if you don't want to capture them. On Friday, April 5, 2013 at 2:28 PM, Nate Thelen wrote:
|
So is it recommended to remove the sentry handler from LOGGING completely? |
@natethelen Most people use it, you just can't log some messages to Sentry (and others you dont want to go there). I use a config like the following:
|
OK, Thanks! |
The only way I was able to make this work was to do this:
|
Hello, This is a big issue for me. When my database goes down, Sentry instantly gets over flooded by psycopg2's My question is: did someone fix it in the meantime ? How can I prevent Raven from shooting certain types of exceptions at Sentry ? FYI, the filter's code:
|
Note that this problem doesn't happen if you implement the filter extending
|
I have a clean install of Django 1.4.5 and raven 3.3.2 (happened in version prior to this) in Python 2.7.3. I have a filter which strips out SuspiciousOperation exceptions like those that happen when using ALLOWED_HOSTS (can see it here: http://www.tiwoc.de/blog/2013/03/django-prevent-email-notification-on-suspiciousoperation/). They successfully are stripped from console, but they still show up in Sentry. One thing that is curious is that the module is always 'root' that the error comes from. Also, during testing, I removed the whole 'root' section from the LOGGING config so that nothing should be going to Sentry at all (as that was the only place sentry was listed as a handler), but I still get entries in Sentry for errors that are happening. This would suggest that something is happening outside of the standard LOGGING config and hence why the filter isn't being respected.
Here is the relevant stuff from my settings file:
The text was updated successfully, but these errors were encountered: