title: Rails: How to write to a custom log file from within a rake task in production mode?
body: <p>I'm trying to write to my log files while running 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.</p>
  
  <p>I read here</p>
  
  <p><a href="https://stackoverflow.com/questions/1022093/how-do-i-use-a-custom-log-for-my-rake-tasks-in-ruby-on-rails/1648159#1648159">How do I use a custom log for my rake tasks in Ruby on Rails?</a></p>
  
  <p>that this is the normal behavior and also found a #wontfix ticket in lighthouse.</p>
  
  <p>My question: Is there a way to output, what's going on while my rake task is running? It performs some crawling and runs for hours. I would prefer if the output went in a specific log file like /log/crawler.log</p>
  
  <p>Right now I'm just using this command to write to the log files:</p>
  
  <pre><code>ActiveRecord::Base.logger.info "Log Text"
  </code></pre>
  
  <p><strong>Thanks!</strong></p>