Skip to content

Commit

Permalink
Add sentry log handler
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Oct 7, 2024
1 parent 5f8ab3f commit 367dc7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ lxml
Pillow
requests==2.*
requests_mock==1.*
sentry-sdk==2.*
12 changes: 11 additions & 1 deletion webapp/webapp/settings/prod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Settings for production."""

import os
import sentry_sdk

from .base import *
from . import validate
Expand Down Expand Up @@ -60,4 +61,13 @@
LOGGING = config.configure_logging(LOG_ROOT)

# Use manifest to manage static file versions for cache busting:
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
STATICFILES_STORAGE = (
'django.contrib.staticfiles.storage'
'.ManifestStaticFilesStorage')

sentry_sdk.init(
dsn="https://[email protected]/20",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
)
1 change: 1 addition & 0 deletions webapp/webapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
path('news/', include('news.urls')),
path('events/', include('events.urls')),
path('people/', include('people.urls')),
path('test-error-handlers/', lambda x: 1 / 0),
]

if settings.DEBUG:
Expand Down

0 comments on commit 367dc7b

Please sign in to comment.