fully remove raven and switch WSGI and logging to sentry_sdk
This commit is contained in:
parent
660972e303
commit
eaa573c715
|
@ -1,5 +1,6 @@
|
|||
"""passbook provider"""
|
||||
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
|
||||
|
||||
from allauth_passbook.provider import PassbookProvider
|
||||
|
||||
urlpatterns = default_urlpatterns(PassbookProvider)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
"""passbook adapter"""
|
||||
import requests
|
||||
|
||||
from allauth.socialaccount import app_settings
|
||||
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
|
||||
OAuth2CallbackView,
|
||||
OAuth2LoginView)
|
||||
|
||||
from allauth_passbook.provider import PassbookProvider
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@ import os
|
|||
from celery import Celery, signals
|
||||
from django.conf import settings
|
||||
|
||||
# from raven import Client
|
||||
|
||||
# set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passbook.core.settings")
|
||||
|
||||
|
|
|
@ -11,3 +11,4 @@ markdown
|
|||
psycopg2
|
||||
PyYAML
|
||||
sentry-sdk
|
||||
pip
|
||||
|
|
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
|
|||
"""
|
||||
|
||||
import importlib
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
@ -19,6 +20,7 @@ from django.contrib import messages
|
|||
from sentry_sdk import init as sentry_init
|
||||
from sentry_sdk.integrations.celery import CeleryIntegration
|
||||
from sentry_sdk.integrations.django import DjangoIntegration
|
||||
from sentry_sdk.integrations.logging import LoggingIntegration
|
||||
|
||||
from passbook import __version__
|
||||
from passbook.lib.config import CONFIG
|
||||
|
@ -220,6 +222,10 @@ sentry_init(
|
|||
integrations=[
|
||||
DjangoIntegration(),
|
||||
CeleryIntegration(),
|
||||
LoggingIntegration(
|
||||
level=logging.INFO,
|
||||
event_level=logging.ERROR
|
||||
)
|
||||
],
|
||||
send_default_pii=True
|
||||
)
|
||||
|
@ -241,7 +247,7 @@ with CONFIG.cd('web'):
|
|||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
LOG_HANDLERS = ['console', 'syslog', 'file', 'sentry']
|
||||
LOG_HANDLERS = ['console', 'syslog', 'file']
|
||||
|
||||
with CONFIG.cd('log'):
|
||||
LOGGING = {
|
||||
|
@ -272,10 +278,6 @@ with CONFIG.cd('log'):
|
|||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'color',
|
||||
},
|
||||
'sentry': {
|
||||
'level': 'ERROR',
|
||||
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
|
||||
},
|
||||
'syslog': {
|
||||
'level': CONFIG.get('level').get('file'),
|
||||
'class': 'logging.handlers.SysLogHandler',
|
||||
|
|
|
@ -10,8 +10,8 @@ https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
|
|||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
|
||||
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'passbook.settings')
|
||||
|
||||
application = Sentry(get_wsgi_application())
|
||||
application = SentryWsgiMiddleware(get_wsgi_application())
|
||||
|
|
Reference in New Issue