Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
What is the different between the get logger functions from celery.utils.log and logging?

I have been trying to figure out the difference between the python logger and the celery logger, specifically the difference between the commands below, but cannot find a good answer.

I am using celery v3, with django 1.10.

from celery.utils.log import get_task_logger
logger = get_logger(__name__)
...
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
...
import logging
logger = logging.get_logger(__name__)

The celery documentation (latest, v3.1) is very lacking on this topic. I have looked at similar questions such as this one, but it is still it unclear which to use, why to use that one, and specifically what the differences are. I am looking for a clear, concise answer.

I am also using sentry in my production environment. How does this choice affect your sentry logs? i.e. these common settings

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

From experience using get_task_logger seems to get you a few things of importance, especially with Sentry.

  • Auto prepending task names to your log output
  • The ability to set log handling rules at a higher level than just module (I believe it's actually setting the logger name to celery.task)
  • Probably, most importantly for Sentry setup, is it hooks the logging into their log handlers which Sentry makes use of.

Important: There is a bit of extra config that needs to go into Celery registration for Sentry:

https://docs.sentry.io/clients/python/integrations/celery/

You may be able to get errors to flow into Sentry without some of this setup, but I think this will give you the best traces and details + ensure that things like expected exceptions declared via throws are properly ignored.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda