Rails 4.0.0-beta1 STDOUT logger

by Steve Hoeksema, posted 19 Mar 2013.

I use Unicorn and Heroku for one Rails application I maintain. I also use this fragment of code from the Heroku website:

config.logger = Logger.new(STDOUT)

This worked fine on Heroku, but locally I got an error after upgrading to Rails 4.0.0-beta1:

wrong number of arguments (0 for 1)
activesupport (4.0.0.beta1) lib/active_support/core_ext/kernel/reporting.rb:82:in `capture'
activerecord (4.0.0.beta1) lib/active_record/migration.rb:345:in `call'

I stumbled across the solution after being sidetracked by a couple of Rails commits, it just needs to be scoped differently:

config.logger = ActiveSupport::Logger.new STDOUT
  1. b7d9d6
  2. 1a9055
Also available as an Atom feed.
This post licensed as CC BY-NC-SA.