My rails app starts the process with rufus-scheduler in the initializer. Here's a truncated version of the initializer code:
logger = RAILS_DEFAULT_LOGGER
logger.warn(Time.now.to_s + ": Starting Rufus Scheduler")
cron_string = '0 10 * * 3'
scheduler = Rufus::Scheduler.start_new
scheduler.cron cron_string do
logger.warn(Time.now.to_s + ": Starting Background Process")
(do work here)
logger.warn(Time.now.to_s + ": Finished Background Process")
end
logger.warn(Time.now.to_s + ": Rufus Scheduler set Background Process to run with the following cron string: [#{cron_string}]")
In all environments, the code works like a champion. The settlement process does its thing and finishes gracefully. The problem, however, is with logging. When RAILS_ENV is set to "production", messages inside the cron block are not logged at all.
I am using Passenger 2.2.9 and Rails 2.3.5. I believe that one of these two things interferes with the registration protocol. Can someone tell me what it is and how to get it to log in?
source
share