Commit 2b187369 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Use Sentry logging and turn off error emails in AWS

parent 47a04356
Pipeline #61946 passed with stages
in 13 minutes and 10 seconds
......@@ -50,3 +50,21 @@ INTERNAL_IPS = [
ADMINS = [
("Tanner Prestegard", "tanner.prestegard@ligo.org"),
]
# Set up Sentry for error logging
sentry_dsn = get_from_env('DJANGO_SENTRY_DSN', fail_if_not_found=False)
if sentry_dsn is not None:
USE_SENTRY = True
# Set up Sentry
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
environment='test',
dsn=sentry_dsn,
integrations=[DjangoIntegration()]
)
# Turn off default admin error emails
LOGGING['loggers']['django.request']['handlers'] = []
......@@ -40,6 +40,23 @@ SEND_EMAIL_ALERTS = True
# # Set up database router
# DATABASE_ROUTERS = ['core.db.routers.NonPriorityRouter',]
# Set up Sentry for error logging
sentry_dsn = get_from_env('DJANGO_SENTRY_DSN', fail_if_not_found=False)
if sentry_dsn is not None:
USE_SENTRY = True
# Set up Sentry
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
environment='production',
dsn=sentry_dsn,
integrations=[DjangoIntegration()]
)
# Turn off default admin error emails
LOGGING['loggers']['django.request']['handlers'] = []
# Safety check on debug mode for production
if (DEBUG == True):
raise RuntimeError("Turn off debug mode for production")
......@@ -29,6 +29,7 @@ phonenumbers==8.8.11
python-ldap==3.1.0
python-memcached==1.59
scipy==1.2.1
sentry-sdk==0.7.10
service_identity==17.0.0
simplejson==3.15.0
Sphinx==1.7.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment