Skip to content

Investigate adding support for Java application logging custom attributes #2729

@jasonjkeller

Description

@jasonjkeller

The Java agent's instrumentation of logging frameworks supports adding custom attributes for libraries that have an MDC API (application_logging.forwarding.context_data.enabled): https://source.datanerd.us/agents/agent-specs/blob/main/Application-Logging.md#configuration-properties

The agent spec also defines a second optional approach for adding custom attributes (application_logging.forwarding.custom_attributes) that functions more similarly to the traditional way of defining custom attributes via agent config:

Agents MAY implement the setting application_logging.forwarding.custom_attributes, which contains key value pairs of custom attributes. These custom attribues SHOULD be sent as part of the common block for every log event payload emitted by the agent. If this is not possible, agents MAY implement this by attaching these as custom attributes to each individual log record.

We should investigate whether we can implement this option such that it works provides an alternative to MDC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions