Getting script/console to log to STDOUT

I just started working on a personal rails project and was shocked to find out that rails doesn’t log messages to STDOUT. Digging through a project at work I noticed that some one added the following to the end of config/environment/development.rb. It’s really a great convenience!

config.logger = Logger.new(STDOUT)
config.logger.level = Logger::INFO

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>