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 7629817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:56:07+00:00 2026-05-31T05:56:07+00:00

I cannot log messages from my delayed_job process. Here is the job that is

  • 0

I cannot log messages from my delayed_job process. Here is the job that is being run.

class MyJob
  def initialize(blahblah)
    @blahblah = blahblah
    @logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))
  end
  def perform
    @logger.add Logger::INFO, "logging from delayed_job"
    #do stuff
  end
end

I’ve tried various logging levels, and I have config.log_level = :debug in my environment configuration. I run delayed_job from monit. I’m using delayed_job 3.0.1 with ruby 1.9.3 and rails 3.0.10.

  • 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-05-31T05:56:10+00:00Added an answer on May 31, 2026 at 5:56 am

    An explation could be that the job gets initialized only once on producer side. Then it gets serialized, delivered through the queue (database for example) and unserialized in the worker. But the initialize method is not being called in the worker process again. Only the perform method is called via send.

    However you can reuse the workers logger to write to the log file:

    class MyJob
      def perform
        say "performing like hell"
      end
    
      def say(text)
        Delayed::Worker.logger.add(Logger::INFO, text)
      end
    end
    

    Don’t forget to restart the workers.

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

Sidebar

Related Questions

I am using Log4Net with the AdoNetAppender to log messages from a simple systray
I have a problem with a client, who cannot log in to our system.
I'm having an issue with a string which is being returned from a webservice.
DBCC SHRINKFILE always works when I run it manually on a log file, even
A web application running in Websphere is using log4j SysLogAppender to log messages to
How do I unsubscribe a LocationListener from recieving updates from the LocationManager ? Here
Are the OS (XP) environmental variables the same used in a process running from
When executing scripts in SQL Server Management Studio, messages are often generated that display
I copied rich push sample from the UrbanAirship.com. And initialize the airship in the
I have a Windows app that contains a browser control that loads pages from

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.