Logging a backtrace

If I catch an exception, is there a way to produce a backtrace that I
can log using something like logger?

rescue Exception => e
            logger.error "#{ e.message } - (#{ e.class })" << "\n" << (e.backtrace or ).join("\n")
         end

That is what I use to get a decent looking backtrace

-Ezra

···

On Aug 26, 2006, at 8:35 PM, snacktime wrote:

If I catch an exception, is there a way to produce a backtrace that I
can log using something like logger?

Thanks, that's just what I was looking for.

···

On 8/26/06, Ezra Zygmuntowicz <ezmobius@gmail.com> wrote:

On Aug 26, 2006, at 8:35 PM, snacktime wrote:

> If I catch an exception, is there a way to produce a backtrace that I
> can log using something like logger?
>

         rescue Exception => e
            logger.error "#{ e.message } - (#{ e.class })" << "\n" <<
(e.backtrace or ).join("\n")
         end

That is what I use to get a decent looking backtrace

-Ezra