Need a way to either replace traceId or add a new attribute for my application's globalId for my log messages #7919
Unanswered
debashish-github
asked this question in
Q&A
Replies: 1 comment 3 replies
-
See https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/logback/logback-appender-1.0/javaagent You'll have to provide the list of MDC attributes you wish to capture. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi..
We are currently in the process of transitioning to open telemetry for our application logging .
Our application is a spring boot java web application that currently uses Logback for logging.
We want to seamlessly move our logging to open telemetry logback appender so that the logs are send to the OLTPExporter .
I am able to add few lines of code and have my applications logs send to OTLPCollector via OTLPExporter in OTLP format.
Now with this setup all my logs have associated traceId and spanId which is auto generated by spring boot starter .
My application already has a globalMessageID that is part of every log message and also present in Logback MDC context .I somehow want this globalMessageID to either replace traceId in the generated logs or be added as an extra attribute to my log records .
I tried to extend the io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender, but it seems it is explicitly denied access to the application source code (only allowed to the test sources) .
What are the different mechanisms available today in the API to allow me this ?
I am stuck up on this . So any help is appreciated !
Thanks
Beta Was this translation helpful? Give feedback.
All reactions