Skip to content

Structured log emits a duplicate key when it appears in both the global context and a per-event field #12

Closed

Description

@OmarAlJarrah

LoggingEvent.log() de-duplicates MDC keys against the union of the global context and the per-event fields, but a key present in BOTH the global context and a per-event field(...) is still written twice — once while emitting the global context and once while emitting the fields (sdk-core/src/main/kotlin/org/dexpace/sdk/core/instrumentation/LoggingEvent.kt) — producing a duplicate key in the emitted JSON object.

This is the same duplicate-key class the per-event/global MDC de-duplication already handles, on a different pair of sources. Suggested fix: when emitting the global context, skip any key also present in the per-event fields (per-event fields win), mirroring the existing MDC guard.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions