Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8119157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:43:23+00:00 2026-06-06T04:43:23+00:00

I’ve a problem with celery’s logger. I have a function that renders frames. I

  • 0

I’ve a problem with celery’s logger. I have a function that renders frames. I log the output of the subprocess I spawn but it seems only the first job picked off the queue by each worker is written. All subsequent tasks in the queue do not produce a log file. I’ve tried using python’s own logging as well and the same issue happens. Is there a configuration I may be missing?

 @task(queue='rndr')
 def rndr(params):

     path      = get_logger_path(params)
     logger    = rndr.get_logger(logfile=path)    
     return render(params, logger)

I define my task this way since my retry logger would be defined differently, ie rndr_retry.get_logger…

My celeryconfig looks like the following:

 BROKER_HOST = "xxx.xxx.xxx.xxx"
 BROKER_PORT = 5672
 BROKER_USER = "xxxx"
 BROKER_PASSWORD = "xxxx"

 CELERY_RESULT_BACKEND = 'amqp'
 CELERY_DISABLE_RATE_LIMITS = True
 CELERY_ACKS_LATE = True
 CELERY_IMPORTS = ['lib.tasks.concatenate', 'lib.tasks.encode', 'lib.tasks.render',  'lib.tasks.still_image', 'lib.tasks.retry']
 CELERY_ROUTES = {'lib.tasks.encode':{'queue': 'encode'},
             'lib.tasks.concatenate':{'queue': 'encode'},
             'lib.tasks.still_image':{'queue': 'encode'},
             'lib.tasks.render':{'queue':'rndr'},
             'lib.tasks.retry':{'queue': 'retry'}
             }

Hoping someone can shed some light as to why only the first task off the queue writes…

Thank you in advance.

update: as requested here’s a partial version of the render method without all the nitty gritty details…

def render(params, logger):

    #load params to local values

    try:
        #create subprocess
        output = child_proc.communicate()[0]

        logger.info('output')
        logger.info(output)       
        ret = child_proc.wait()                
        if ret not in [0,1]:
            raise Exception('subprocess failed')              

    except Exception, exc:
        logger.info(' '.join(str(x) for x in exc.args))
        #mark as failed...
        return          

    return

I should add that not only does the file not get written during subsequent tasks, it doesn’t even create a log file….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:43:25+00:00Added an answer on June 6, 2026 at 4:43 am

    After some trials, I notice the log file passed wasn’t being created. I added a method to assure the file existed before passing it to get_logger(). Still no luck. Since most of my tasks run subprocess, I decided to take a simpler approach and have an open file object and pass that to the subprocess call in stdout and stderr and close the file object where appropriate. This seems to work no matter how many tasks I run. I should note each task writes to a unique file.

    Anyhoo, I think I’ll write to the celery devs and mark it as a bug. I had read somewhere in dev forums somewhere that the logger for celery was in need of some love.

    Cheers.

    Update:

    After speaking with the devs of celery it was concluded that the logger isn’t meant to be used this way. An instance of logging starts for a task but repeated tasks would not log. I ended up simply writing to a file to circumvent issues with the Logging module. Does the trick and doesn’t cause any collisions as each render task uses a unique file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.