Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 99e3a8e

Browse files
author
Til Boerner
committed
Respect CELERY_LOGLEVEL setting in SentryDjangoHandler
1 parent 93b8aab commit 99e3a8e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

raven/contrib/django/models.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,12 @@ def install_celery(self):
174174
ignore_expected=ignore_expected)\
175175
.install()
176176

177-
# try:
178-
# ga = lambda x, d=None: getattr(settings, 'SENTRY_%s' % x, d)
179-
# options = getattr(settings, 'RAVEN_CONFIG', {})
180-
# loglevel = options.get('celery_loglevel',
181-
# ga('CELERY_LOGLEVEL', logging.ERROR))
182-
183-
# register_logger_signal(client, loglevel=loglevel)
184-
# except Exception:
185-
# logger.exception('Failed to install Celery error handler')
177+
loglevel = (
178+
getattr(settings, 'RAVEN_CONFIG', {}).get('CELERY_LOGLEVEL')
179+
or getattr(settings, 'SENTRY_CELERY_LOGLEVEL', None)
180+
)
181+
if loglevel is not None:
182+
register_logger_signal(client, loglevel=loglevel)
186183

187184
def install(self):
188185
request_started.connect(self.before_request, weak=False)

0 commit comments

Comments
 (0)