diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index b49b2185f..5ef03c26a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -198,7 +198,7 @@ SENTRY_DSN = env('SENTRY_DSN') SENTRY_CELERY_LOGLEVEL = env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO) sentry_logging = LoggingIntegration( - level=SENTRY_CELERY_LOGLEVEL, # Capture info and above as breadcrumbs + level=DJANGO_SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs event_level=None # Send no events from log messages ) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 3a138303c..6222941b7 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,10 +8,10 @@ psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -raven==6.9.0 # https://github.com/getsentry/raven-python +sentry-sdk==0.3.7 # https://docs.sentry.io/quickstart/?platform=python {%- endif %} # Django # ------------------------------------------------------------------------------ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages -django-anymail[mailgun]==4.2 # https://github.com/anymail/django-anymail \ No newline at end of file +django-anymail[mailgun]==4.2 # https://github.com/anymail/django-anymail diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py index ab789b180..5392bcdf0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py @@ -2,8 +2,6 @@ import os from celery import Celery - - from django.apps import apps, AppConfig from django.conf import settings @@ -38,15 +36,16 @@ class CeleryAppConfig(AppConfig): {%- endif %} import sentry_sdk from sentry_sdk.integrations.celery import CeleryIntegration + from sentry_sdk.integrations.logging import LoggingIntegration {% if cookiecutter.use_pycharm == 'y' -%} # @formatter:on {%- endif %} - sentry_logging = LoggingIntegration( - level=settings.SENTRY_CELERY_LOGLEVEL, # Capture info and above as breadcrumbs - event_level=None # Send no events from log messages - ) - sentry_sdk.init(dsn=settings.SENTRY_DSN, integrations=[sentry_logging, CeleryIntegration()]) - {%- endif %} + sentry_logging = LoggingIntegration( + level=settings.SENTRY_CELERY_LOGLEVEL, # Capture info and above as breadcrumbs + event_level=None # Send no events from log messages + ) + sentry_sdk.init(dsn=settings.SENTRY_DSN, integrations=[sentry_logging, CeleryIntegration()]) + {%- endif %} @app.task(bind=True)