Issue
Is there a way to filter out specific error messages using Django Logging? eg UncompressableFileError
Would like to stop these errors being sent to Sentry.io
Solution
You can set a Filter
on the Sentry handler which checks for the type of errors you want to filter out, and return False
to drop them. Roughly:
def sentry_filter(record):
return 'UncompressableFileError' not in record.getMessage()
and then
sentry_handler.addFilter(sentry_filter)
This might need to be tweaked depending on where the string occurs - e.g. in message or traceback
Answered By - Vinay Sajip
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.