Setting up a Debug Log
Have you ever been debugging your Rails application and watching the development log fly by wishing that you could put output just the information you need to its own log? There’s actually a quick and easy way to do it.
First, you create your logger.
@debug_log = Logger.new(File.open(File.dirname(__FILE__) + "/../../log/debug.log", "w"))
Then you log data to it.
@debug_log.debug @object
It’s simple and it makes the data extremely easy to find. Just take the statements out when you’re done debugging.