From cf2c27aedd8d3f63f40e882c9a6cf9106744c105 Mon Sep 17 00:00:00 2001 From: Ovv Date: Thu, 31 Jan 2019 13:56:53 +0100 Subject: [PATCH] sentry integration --- src/paperless/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 531e8436e..6c1b7291c 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -257,6 +257,18 @@ def __get_boolean(key, default="NO"): }, } +if os.getenv("PAPERLESS_SENTRY_DSN"): + import sentry_sdk + from sentry_sdk.integrations.django import DjangoIntegration + + sentry_logging = LoggingIntegration( + level=logging.INFO, # Capture info and above as breadcrumbs + event_level=logging.ERROR # Send errors as events + ) + sentry_sdk.init( + dsn=os.getenv("PAPERLESS_SENTRY_DSN"), + integrations=[sentry_logging, DjangoIntegration()] + ) # The default language that tesseract will attempt to use when parsing # documents. It should be a 3-letter language code consistent with ISO 639.