diff options
author | Diego Parra <diegolparra@gmail.com> | 2013-09-19 08:58:34 -0300 |
---|---|---|
committer | Diego Parra <diegolparra@gmail.com> | 2013-10-01 17:52:28 -0300 |
commit | 5ffb3a50be348237fda9a8176b508284c59261af (patch) | |
tree | 0d83e1d25bf4a7c2fbff67dc53316954d7706171 /kamon-core/src/main/scala/kamon/newrelic | |
parent | fdd4b8817a57c94f7228c5ad6a8028f5aa7a21e4 (diff) | |
download | Kamon-5ffb3a50be348237fda9a8176b508284c59261af.tar.gz Kamon-5ffb3a50be348237fda9a8176b508284c59261af.tar.bz2 Kamon-5ffb3a50be348237fda9a8176b508284c59261af.zip |
Envelope Instrumentation and some cleanup
Diffstat (limited to 'kamon-core/src/main/scala/kamon/newrelic')
-rw-r--r-- | kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala | 19 |
1 files changed, 19 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..72bcb4e2 --- /dev/null +++ b/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala @@ -0,0 +1,19 @@ +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 = { + println(error.message) + noticeError(error.cause) + } +} |