newrelic-java-agent icon indicating copy to clipboard operation
newrelic-java-agent copied to clipboard

Bring Application Logging Log Forwarding Functionality Into Alignment With Agent Spec

Open jasonjkeller opened this issue 2 years ago • 1 comments

The Java agent was one of the first agents to release support for log forwarding. A few new features were added to the agent spec after the Java agent released. When the roadmap permits we should look into adding this functionality to the Java agent's log forwarding feature.

https://source.datanerd.us/agents/agent-specs/blob/main/Application-Logging.md#conditions-for-reporting-log-records

Feature 1: log_level

When the agent's language has built-in log severity levels, a log record MUST NOT be added to the reservoir if it is less severe than the value of application_logging.forwarding.log_level. For example, in Ruby if the WARN or 2 level is set as application_logging.forwarding.log_level, a call to logger.warn MUST result in a log record being added to the reservoir, but a logger.info call (level 1, less severe) MUST NOT result in a log record being added to the reservoir.

Feature 2: denylist

When the agent's language does not have built-in log severity levels, a log record MUST NOT be added to the reservoir if it is configured to be filtered out in the application_logging.forwarding.denylist. For example, if the "warn" level has been added to the denylist, a logger call such as logger.warn("A dire warning.") must not result in a log record being added to the reservoir.

jasonjkeller avatar Dec 15 '23 00:12 jasonjkeller

https://new-relic.atlassian.net/browse/NR-191359