newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 144 forks source link

Bring Application Logging Log Forwarding Functionality Into Alignment With Agent Spec #1665

Open jasonjkeller opened 11 months ago

jasonjkeller commented 11 months ago

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.

workato-integration[bot] commented 11 months ago

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