title: Rails + Heroku + RSpec : How to control logging
body: <p>I have a Ruby on Rails 3.2 application which runs on Heroku. I'm using RSpec for my test suite. </p>
  
  <p>When I started, I just used statements such as </p>
  
  <pre><code>p "Order completed at #{Time.now.to_s}"
  </code></pre>
  
  <p>to generate logs. I did this because Heroku uses its magical jiggery-pokery to divert all logs to STDOUT anyways. </p>
  
  <p>However, my test suite prints all kinds of logs to STDOUT now, and it is very distracting. I would like those logs to appear when the application is deployed to Heroku, but I don't want to see them on my STDOUT output along with my RSpec output. </p>
  
  <p>Is there a way to divert STDOUT to a file such as log/test.log, or alternatively, use a logging API which will do what I want?</p>