track logs for scheduler using Whenever gem, Ruby and sinatra -
i have written scheduler using "whenever gem", have 2 schedulers in scheduler.rb file. want logs scheduled tasks, have set :output, "log/cron_log.log"
in scheduler.rb. logs schedulers logged in log file, instead want output logged 1 scheduler , not other scheduler. how can this?
my scheduler.rb
set :output, "log/cron_log.log" #donot set output log this. every 6.hours rake "sidekiq:restart" end #set output log scheduler every :day, :at => '01:00am' rake 'prune_users:older_than_2months' end
you can try
# donot set output log this. every 6.hours rake "sidekiq:restart" end # set output log scheduler every :day, :at => '01:00am' rake 'prune_users:older_than_2months', :output => {:error => 'error.log', :standard => 'cron.log'} end
btw, can refer @ link: https://github.com/javan/whenever/wiki/output-redirection-aka-logging-your-cron-jobs
Comments
Post a Comment