diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-31 03:14:32 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-31 03:14:32 +0100 |
commit | 992dd3007a6ddd24bf2aaf952aeacab7d8d9fb1a (patch) | |
tree | 87d874030e28a19638b9b4e4a80a658976f4043d /kamon-core/src/main/scala/kamon/trace/logging | |
parent | 7b3928c881c85152bee88019da9d76a0cfa5359f (diff) | |
parent | 508336438227fc89eb732565bd19cb254572e533 (diff) | |
download | Kamon-992dd3007a6ddd24bf2aaf952aeacab7d8d9fb1a.tar.gz Kamon-992dd3007a6ddd24bf2aaf952aeacab7d8d9fb1a.tar.bz2 Kamon-992dd3007a6ddd24bf2aaf952aeacab7d8d9fb1a.zip |
Merge branch 'wip/improve-trace-context-and-segments-api', closes #65
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace/logging')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/logging/LogbackTraceTokenConverter.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/logging/LogbackTraceTokenConverter.scala b/kamon-core/src/main/scala/kamon/trace/logging/LogbackTraceTokenConverter.scala index 4b7dbb28..f052f009 100644 --- a/kamon-core/src/main/scala/kamon/trace/logging/LogbackTraceTokenConverter.scala +++ b/kamon-core/src/main/scala/kamon/trace/logging/LogbackTraceTokenConverter.scala @@ -20,5 +20,11 @@ import ch.qos.logback.classic.spi.ILoggingEvent import kamon.trace.TraceRecorder class LogbackTraceTokenConverter extends ClassicConverter { - def convert(event: ILoggingEvent): String = TraceRecorder.currentContext.map(_.token).getOrElse("undefined") + def convert(event: ILoggingEvent): String = { + val ctx = TraceRecorder.currentContext + if (ctx.isEmpty) + "undefined" + else + ctx.token + } } |