Open sebarys opened 4 years ago
Ok, I figured this out:
Using sbt-native-packager
(works also with sbt assembly
)logback.xml
only ContextTagConverter
is required and to call variables put into context before use %contextTag{KEY_NAME}
syntax
<conversionRule conversionWord="contextTag" converterClass="kamon.instrumentation.logback.tools.ContextTagConverter" />
...
<provider class="net.logstash.logback.composite.loggingevent.LoggingEventPatternJsonProvider">
<pattern>
{
"logger":"%logger",
"message":"%msg",
"thread":"%thread",
"actor":"%X{akkaSource}",
"clientName":"%contextTag{clientName}",
"otherOptionalParam":"%contextTag{otherOptionalParam}",
"traceId":"%contextTag{traceId}"
}
</pattern>
</provider>
There are many places where documentation (even latest) is inconsistent, I think that having simple example app with akka http endpoint where actor is requested to process sth to show how integrate with the newest version of Kamon context propagation, metrics and logback (IMO 3 most used features) would help a lot people that just started using your framework.
Hello,
I've tried migrate to Kamon
2.1.4
from1.1.6
. Application is forming akka-cluster and use communication between actors to process some logic. We're using context propagation to have some informations in logs like traceId, clientName etc.In Kamon 1.x we had util function to init context:
those informations were used later to log context values in log entries using
"io.kamon" %% "kamon-logback" % "1.0.7"
it was converted after migration to Kamon 2.x to:
Unfortunately after migration values that were propagated properly, now aren't propagated, instead each field is reporting null.
Am I missing some not documented configuration part or I need add sth more to build.sbt than dependency to
and init Kamon before creating actorSystem:
?
Thanks in advance for help :)