- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1k
 
Description
Describe the bug
Hey folks.
We're using opentelemetry java agent 2.20.1 with logback 1.5.19 in a Spring Boot 3.1.9 application under JDK 21, but using the agent plain without Spring auto-configuration using -javaagent and env/system-properties.
It seems the default instrumentation of Logback appenders changes the behavior of how appenders can work with the ILoggingEvent that is passed via doAppend.
We have a custom appender in place, that does PII redaction of log statements, by inspecting the arguments provided by the event. If it detects any PII related data in such, it will replace the content of the argument with "redacted". This worked fine for now. But when we enabled the OTEL agent, our appender gets still called and it also redacts the arguments, but still the log statement contains the un-redacted log message. It seems that the modification to the arguments array is not respected anymore but ignored.
For now we disabled the appender instrumentation using OTEL_INSTRUMENTATION_LOGBACK_APPENDER_ENABLED=false and everything is back to normal. But I'm curious if this is a bug that needs fixing or expected behavior :). Thanks!
Steps to reproduce
Create a custom appender, register it and within the doAppend(), modify the arguments of the ILoggingEvent parameter with some values.
Expected behavior
The changed arguments should appear in the final log message.
Actual behavior
The origin arguments appear in the final log message.
Javaagent or library instrumentation version
2.20.1
Environment
JDK: openjdk version "21.0.8" 2025-07-15 LTS
OS: Debian trixie/sid
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.