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