diff options
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala index ed787332..248aa03e 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala @@ -18,7 +18,7 @@ package kamon.newrelic import akka.actor.Actor import akka.event.Logging.Error import akka.event.Logging.{ LoggerInitialized, InitializeLogger } -import com.newrelic.api.agent.{ NewRelic ⇒ NR } +import com.newrelic.api.agent.NewRelic import kamon.trace.ContextAware class NewRelicErrorLogger extends Actor { @@ -35,7 +35,12 @@ class NewRelicErrorLogger extends Actor { for (c ← ctx) { params.put("UOW", c.uow) } + + if (error.cause == Error.NoCause) { + NewRelic.noticeError(error.message.toString, params) + } else { + NewRelic.noticeError(error.cause, params) + } - NR.noticeError(error.cause, params) } } |