I am trying to write to my log files during a rake task. It works fine in development mode, but as soon as I switch to the production environment, nothing is written to the log files.
I read here
How to use my own log for my rake tasks in Ruby on Rails?
that this is normal behavior, and also found the #wontfix ticket in the lighthouse.
My question is: is there a way to deduce what happens when my rake task is executed? It performs some scans and works for several hours. I would prefer the output to go to a specific log file, e.g. /log/crawler.log
Now I just use this command to write to the log files:
ActiveRecord::Base.logger.info "Log Text"
Thanks!
ruby-on-rails logging web-crawler rake
Ole spaarmann
source share