Sentry: Tune log levels

This commit is contained in:
Raphael Michel
2019-02-05 16:35:40 +01:00
parent 48b399424a
commit b9c570b3d8
2 changed files with 16 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ def widget_js(request, lang, **kwargs):
try: try:
resp = HttpResponse(default_storage.open(fname).read(), content_type='text/javascript') resp = HttpResponse(default_storage.open(fname).read(), content_type='text/javascript')
except: except:
logger.exception('Failed to open widget.js') logger.critical('Failed to open widget.js')
if not resp: if not resp:
data = generate_widget_js(lang).encode() data = generate_widget_js(lang).encode()

View File

@@ -1,4 +1,5 @@
import configparser import configparser
import logging
import os import os
import sys import sys
@@ -567,17 +568,28 @@ LOGGING = {
if config.has_option('sentry', 'dsn'): if config.has_option('sentry', 'dsn'):
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.logging import ignore_logger from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
from .sentry import PretixSentryIntegration from .sentry import PretixSentryIntegration
sentry_sdk.init( sentry_sdk.init(
dsn=config.get('sentry', 'dsn'), dsn=config.get('sentry', 'dsn'),
integrations=[PretixSentryIntegration(), CeleryIntegration()], integrations=[
PretixSentryIntegration(),
CeleryIntegration(),
LoggingIntegration(
level=logging.INFO,
event_level=logging.CRITICAL
)
],
environment=SITE_URL, environment=SITE_URL,
release=__version__, release=__version__,
send_default_pii=False send_default_pii=False,
) )
ignore_logger('pretix.base.tasks') ignore_logger('pretix.base.tasks')
ignore_logger('pretix.plugins.stripe')
ignore_logger('pretix.plugins.paypal')
ignore_logger('pretix.plugins.banktransfer')
CELERY_TASK_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json'