From 3b285a89dd194106de74cd708fea657f8c7fdfcf Mon Sep 17 00:00:00 2001 From: sweenu Date: Mon, 6 Jul 2026 13:38:28 +0300 Subject: [PATCH] Sentry: Optionally enable sending logs (#6222) * Enable sending logs to Sentry * change to info --------- Co-authored-by: Raphael Michel --- src/pretix/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/settings.py b/src/pretix/settings.py index 3cbdf4ff1..42d9e1e45 100644 --- a/src/pretix/settings.py +++ b/src/pretix/settings.py @@ -716,6 +716,7 @@ if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell from .sentry import PretixSentryIntegration, setup_custom_filters SENTRY_TOKEN = config.get('sentry', 'traces_sample_token', fallback='') + SENTRY_ENABLE_LOGS = config.getboolean('sentry', 'enable_logs', fallback=False) pretix_denylist = DEFAULT_DENYLIST + [ "access_token", "sentry_dsn", @@ -740,7 +741,8 @@ if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell CeleryIntegration(), LoggingIntegration( level=logging.INFO, - event_level=logging.CRITICAL + event_level=logging.CRITICAL, + sentry_logs_level=logging.INFO, ) ], traces_sampler=traces_sampler, @@ -748,6 +750,7 @@ if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell release=__version__, event_scrubber=EventScrubber(denylist=pretix_denylist, recursive=True), send_default_pii=False, + enable_logs=SENTRY_ENABLE_LOGS, propagate_traces=False, # see https://github.com/getsentry/sentry-python/issues/1717 ) ignore_logger('pretix.base.tasks')