Rails newrelic 监控自定义异常

wildwind · June 27, 2014 · Last by zhangyuan replied at June 27, 2014 · 2172 hits

自定义了一个继承自 StandardError 的类 TestError,发生异常时,主动 raise TestError.new(message: 'xxxxxx'),newrelic 上看到的异常信息是 TestError,怎样才能看到 message 信息呢?

试试这个方法通知 NewRelic

NewRelic::Agent.notice_error(exception, options)

#1 楼 @zhangyuan 找到了,thx

raise TestError.new('error message on newrelic')

You need to Sign in before reply, if you don't have an account, please Sign up first.