newrelic / newrelic/newrelic-java-agent
Investigate adding support for Java application logging custom attributes
@obenkenobi is already working on this.
Since Aug 13, 2026.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.