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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -