Fix caller data lost in logback mdc library instrumentation #12220
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Resolves #12198
Instead of wrapping the logging event use reflection to update it. The current event wrapping solution uses
LoggingEventVO.buildbecauseLoggingEventPreSerializationTransformeraccepts onlyLoggingEventVOorLoggingEvent, but usingLoggingEventVOlooses access to caller data. Instead of the jdk proxy that we currently use we could use a custom proxy that extendsLoggingEvent, but that is also problematic because our proxy would need to implement all methods that exist in any version ofLoggingEvent(https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LoggingEventToReplay.java is similar in that regard) and it wouldn't be future proof (can't proactively handle methods that are added in future versions).A limitation of proposed implementation is that it can only handle events of type
LoggingEvent. This means that our appender needs to be arranged before other appenders that wrap the event.