Closed amelnikov-mylivn closed 5 years ago
If the default value is provided - ContextEntryConverter uses the wrong entry name.
Let's say this is my logback pattern %contextEntry{MyValue:MyDefault}
%contextEntry{MyValue:MyDefault}
If we follow the code at https://github.com/kamon-io/kamon-logback/blob/78a1ec1ff64128443b5c20afcda72a69a5d2d093/src/main/scala/kamon/instrumentation/logback/tools/ContextEntryConverter.scala#L35
we will see that getFirstOption will have value MyValue:MyDefault where it should be MyValue. Therefore if the default is specified - the original value will be always ignored.
getFirstOption
MyValue:MyDefault
MyValue
If the default value is provided - ContextEntryConverter uses the wrong entry name.
Let's say this is my logback pattern
%contextEntry{MyValue:MyDefault}
If we follow the code at https://github.com/kamon-io/kamon-logback/blob/78a1ec1ff64128443b5c20afcda72a69a5d2d093/src/main/scala/kamon/instrumentation/logback/tools/ContextEntryConverter.scala#L35
we will see that
getFirstOption
will have valueMyValue:MyDefault
where it should beMyValue
. Therefore if the default is specified - the original value will be always ignored.