You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/apm/agents/net-agent/configuration/net-agent-configuration.mdx
+16-1
Original file line number
Diff line number
Diff line change
@@ -3554,6 +3554,7 @@ There are three main sub-features:
3554
3554
2. Log forwarding: When enabled, the agent will capture log data and send it to New Relic.
3555
3555
* Context data (via [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)): When enabled, the agent will capture and forward any custom log attributes. The `include` and `exclude` elements are comma-separated lists of attribute names to include or exclude, following the [same rules](/docs/apm/agents/net-agent/attributes/enable-disable-attributes-net/#attruls) as other agent attribute configuration. They're both empty by default, which results in all log context data being captured and forwarded.
3556
3556
* Log-level filtering: When configured with one or more log levels in a comma-separated list, the agent will prevent messages at those levels from being captured and forwarded.
3557
+
* Labels: When enabled, the agent adds custom labels to agent-forwarded logs. You can use the `exclude` attribute, which is a case-insensitive, comma-separated list of label names. By default, the agent adds custom labels when the `exclude` attribute is empty.
3557
3558
3. Local log decoration: When enabled, your existing logs will be decorated with metadata which links logs with other New Relic data, such as errors.
3558
3559
3559
3560
For more details, see [our docs on using .NET agent logs in context](/docs/logs/logs-context/net-configure-logs-context-all).
@@ -3563,6 +3564,7 @@ For more details, see [our docs on using .NET agent logs in context](/docs/logs/
@@ -3661,6 +3665,17 @@ The `applicationLogging` element supports the following attributes and sub-eleme
3661
3665
The include and exclude lists follow the [same precedence rules as other agent attributes configuration](/docs/apm/agents/net-agent/attributes/enable-disable-attributes-net/#attruls).
3662
3666
</Collapser>
3663
3667
3668
+
<Collapser
3669
+
id="labels"
3670
+
title="labels (tags)"
3671
+
>
3672
+
Use this sub-element, which is a child of the `forwarding` element, to configure adding your [labels (tags)](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#labels-tags) to agent-forwarded logs, in agent versions 10.34.0 and higher.
3673
+
3674
+
Set the `enabled` attribute to `true` to enable adding your labels to agent-forwarded logs. You can also use the environment variable `NEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_ENABLED`. The default value is `false`.
3675
+
3676
+
The `exclude` attribute is a case-insensitive, comma-separated list of label names to exclude when you enable labels. You can also use the environment variable `NEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_EXCLUDE`. The default value is an empty string, which means "exclude nothing". This attribute does not support wildcards or regex.
3677
+
</Collapser>
3678
+
3664
3679
<Collapser
3665
3680
id="localDecorating"
3666
3681
title="Local log decoration"
@@ -3870,4 +3885,4 @@ For .NET Core apps, you can configure the following settings in `appsettings.jso
3870
3885
3871
3886
<Calloutvariant="important">
3872
3887
For [ASP.NET Core apps](https://asp.net/), the .NET Agent will read from `appsettings.{environment}.json` if you set the `ASPNETCORE_ENVIRONMENT` variable.
0 commit comments