Sentry: Optionally enable sending logs (#6222)

* Enable sending logs to Sentry

* change to info

---------

Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
sweenu
2026-07-06 12:38:28 +02:00
committed by GitHub
co-authored by Raphael Michel
parent c1683df1fd
commit 3b285a89dd
+4 -1
View File
@@ -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')