From 19e73630ab2dfbe81047323012567849e0afb660 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 10 Apr 2021 23:20:20 +0200 Subject: [PATCH] lib: discard all log messages from dbbackup Signed-off-by: Jens Langhammer --- authentik/lib/sentry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/authentik/lib/sentry.py b/authentik/lib/sentry.py index e9eacfd8f..189f0d264 100644 --- a/authentik/lib/sentry.py +++ b/authentik/lib/sentry.py @@ -22,7 +22,7 @@ class SentryIgnoredException(Exception): """Base Class for all errors that are suppressed, and not sent to sentry.""" -def before_send(event, hint): +def before_send(event: dict, hint: dict) -> dict: """Check if error is database error, and ignore if so""" ignored_classes = ( # Inbuilt types @@ -64,4 +64,7 @@ def before_send(event, hint): _, exc_value, _ = hint["exc_info"] if isinstance(exc_value, ignored_classes): return None + if "logger" in event: + if event["logger"] in ["dbbackup"]: + return None return event