# OneAgent modifying log messages for Java

**URL:** <https://community.dynatrace.com/t/oneagent-modifying-log-messages-for-java/43332>\
**Category:** Open Q&A\
**Tags:** latest-dynatrace, oneagent\
**Created:** [December 21, 2023, 12:46pm UTC](https://community.dynatrace.com/t/oneagent-modifying-log-messages-for-java/43332 "2023-12-21T12:46:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brenol](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@brenol](https://community.dynatrace.com/u/brenol)\
**Post date:** [December 21, 2023, 12:46pm UTC](https://community.dynatrace.com/t/oneagent-modifying-log-messages-for-java/43332/1 "2023-12-21T12:46:30Z")

</div>

Hello!

We have a OneAgent installation that is causing trouble for us as it’s modifying our log messages. We’re not using OneAgent SDK for Java.

OneAgent is removing our `span_id` and `trace_id` fields from all log messages. However, it is not adding the `dt.trace_id` and `dt.span_id` fields to the log messages.

We’re using Logback with&nbsp;opentelemetry-logback-mdc-1.0. We also tried removing&nbsp;opentelemetry-logback-mdc-1.0 but OneAgent doesn’t add the dt.trace\_id and dt.span\_id fields, even if we configure Logback’s provider.

Removing OneAgent container from the deployment works (we’re using ECS with Fargate). Is there any way to make OneAgent stop messing with the log messages? Or some way for us to troubleshoot what’s going on.

Does anyone know what can be done on this case? I do know OneAgent tries to prevent Span duplication in java ([Use OneAgent with OpenTelemetry data — Dynatrace Docs](https://docs.dynatrace.com/docs/extend-dynatrace/opentelemetry/getting-started/traces/oneagent)) but I don’t think thats whats happening, as the span\_id/trace\_id works when not used manually (@NewSpan in Micronaut).

We’re running on the JVM. Any ideas on how we can fix this will be of great help. 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [December 21, 2023, 12:54pm UTC](https://community.dynatrace.com/t/oneagent-modifying-log-messages-for-java/43332/2 "2023-12-21T12:54:22Z")

</div>

Here you have a similar problem described:  
[https://community.dynatrace.com/t5/Open-Q-A/quot-dt-trace-sampled-dt-trace-id-dt-span-id-quot-are-getting/td-p/199653](https://community.dynatrace.com/topic/199653)

If this does not help then the best thing to do in this situation in my opinion is to report the problem to support.

Radek
