forked from CGM_Public/pretix_original
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user