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