I have a rake task running in the background using Delayed_Job. When I'm in development, the rake task writes to a rake.log file. But how do I get the log file written to in production?
I am on Cedar at Heroku with a rails 3.1 app. I have the heroku Logging addon installed, set to Expanded. I am using both 'puts' and 'Rails.logger' in the rake script. heroku logs and logs --tail works beautifully as a logger for the rest of the app, but the only logs for the rake task say that the worker process has started successfully.
The heroku docs say that "Anything written to standard out (stdout) o开发者_如何学运维r standard error (stderr) is captured into your logs. This means that you can log from anywhere in your application code with a simple puts statement". How can I make this true for code within a delayed job rake task?
精彩评论