Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celery truncates log messages

My Celery log consistently truncates (not very) long error messages, like this:

[2012-04-08 04:53:10,084: INFO/MainProcess] Task mainapp.tasks.async_submitter[2df2fe93-156b-4944-9ecf-c55ba53e8aaa] succeeded in 0.190640926361s: 'An error occurred during the submission of...

Needless to say, this removes half the purpose of logging. How can I stop this from happening?

I'm running celery with django-celery (through django-supervisor with supervisor) on linux.

like image 756
Marcin Avatar asked Apr 08 '12 09:04

Marcin


1 Answers

Unfortunately, Celery will truncate messages by default yes.

From version 3.1.7 to 3.1.9 it seems to be possible to tweak this limit by patching a module's global:

import celery.worker.job

celery.worker.job.RESULT_MAXLEN = 1048576  # 1 Mib
like image 117
Romuald Brunet Avatar answered Oct 23 '22 12:10

Romuald Brunet