A similar way to achieve this without resorting to digging into ActiveRecord
internals and using instance variables is to just access the config
object that Rails gives you. Place this inside config/application.rb
:
config.logger = Logger.new(STDOUT) if($0 == 'irb' || $0 == 'script/rails')