Reputation: 26091
I have a rake file that is being called by a job scheduler. The file outputs the desc but I am not able to log anything else to the console. What am I missing?
inbox.rake
namespace :inbox do
desc 'Check inbox for new app builds'
task process_inbox: :environment do
puts "my task is working"
end
end
Upvotes: 3
Views: 3904
Reputation: 2389
Similar to Heroku logs, you need STDOUT to see the outputs. Could be as simple as
my_logger = Logger.new(STDOUT)
my_logger.info "work or die"
Upvotes: 3
Reputation: 40961
puts
sends the text to STDOUT
, which is different when you run rake
from the terminal versus invoking from another ruby process.
Where do you expect to see this text?
Upvotes: 1
Reputation: 1421
Try manually printing to console.
namespace :inbox do
desc 'Check inbox for new app builds'
task process_inbox: :environment do
Rails.logger.info "my task is working"
end
end
Upvotes: 1