diff options
author | Diego Parra <diegolparra@gmail.com> | 2013-09-19 08:58:34 -0300 |
---|---|---|
committer | Diego Parra <diegolparra@gmail.com> | 2013-09-19 08:58:34 -0300 |
commit | 88af5cf513e44efcf84bc7f92e02deb3c7597686 (patch) | |
tree | 61c031b740378d4539c9a6595c115cd62a542ff9 /kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala | |
parent | e457fb4d3b8535c27343c80c45fdbe7fa7a93dae (diff) | |
download | Kamon-88af5cf513e44efcf84bc7f92e02deb3c7597686.tar.gz Kamon-88af5cf513e44efcf84bc7f92e02deb3c7597686.tar.bz2 Kamon-88af5cf513e44efcf84bc7f92e02deb3c7597686.zip |
first and simple implementation of NewRelicErrorLogger
Diffstat (limited to 'kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala b/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala new file mode 100644 index 00000000..4bc49496 --- /dev/null +++ b/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala @@ -0,0 +1,18 @@ +package kamon.newrelic + +import akka.actor.Actor +import akka.event.Logging.Error +import akka.event.Logging.{LoggerInitialized, InitializeLogger} +import com.newrelic.api.agent.NewRelic +import NewRelic.noticeError + +class NewRelicErrorLogger extends Actor { + def receive = { + case InitializeLogger(_) => sender ! LoggerInitialized + case error @ Error(cause, logSource, logClass, message) => notifyError(error) + } + + def notifyError(error: Error): Unit = { + noticeError(error.cause) + } +} |