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
logger.error $!
You can also use ruby's default variables, like this:
logger.error "Your error message. Exception message:#{$!} Stacktrace:#{$@}"