I am working on rails project and I am trying to get exceptions to be logged to the rails log files. I know I can call logger.error $!
to get the first line of the
The way rails does it is
137 logger.fatal(
138 "\n\n#{exception.class} (#{exception.message}):\n " +
139 clean_backtrace(exception).join("\n ") +
140 "\n\n"
141 )
248 def clean_backtrace(exception)
249 if backtrace = exception.backtrace
250 if defined?(RAILS_ROOT)
251 backtrace.map { |line| line.sub RAILS_ROOT, '' }
252 else
253 backtrace
254 end
255 end
256 end