Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Log a backtrace in rails (See related posts)

If you're in a tough spot, debugging-wise, in your rails app, you can log your entire backtrace to see who called whom. Just put this snippet in the troublesome spot:

      begin
        raise "boom"
      rescue => detail
        RAILS_DEFAULT_LOGGER.info detail.backtrace.join("\n")
      end

Comments on this post

cheapRoc posts on Feb 09, 2009 at 18:31
Better yet...

Rails.logger.warn "We're doomed!"

You need to create an account or log in to post comments to this site.