newrelic / newrelic/newrelic-java-agent

Investigate adding support for Java application logging custom attributes

Open
#2,729 1 comment 0 reactions 1 assignee View on GitHub

@obenkenobi is already working on this.

Since Aug 13, 2026.

spec-compliance
Dominant language
Java
Stars
240
Forks
170
Avg merge
3d 2h
Merged PRs (30d)
21

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.