Failed to send Celery task log messages to Sentry

I have a problem with Sentry magazine from celery task. Errors in tasks work fine. However, when I try to manually log an event, it is logged in celery logs, but not on the clock server.

The code I use is:

@task def myWorker(): logger = logging.getLogger('celery.task') logger.addHandler(SentryHandler()) logger.warn("Some condition happened", exc_info=True, extra={ 'extra': 'data' }) 

I found some posts here and around the web, but they all look very outdated

+6
source share

Source: https://habr.com/ru/post/945625/


All Articles