Skip to content

Commit 3f73dbb

Browse files
Updated the document
1 parent 52c5191 commit 3f73dbb

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/content/docs/apm/agents/net-agent/configuration/net-agent-configuration.mdx

+16-1
Original file line numberDiff line numberDiff line change
@@ -3554,6 +3554,7 @@ There are three main sub-features:
35543554
2. Log forwarding: When enabled, the agent will capture log data and send it to New Relic.
35553555
* 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.
35563556
* 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.
35573558
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.
35583559

35593560
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/
35633564
<metrics enabled="true" />
35643565
<forwarding enabled="true" maxSamplesStored="10000" logLevelDenyList="">
35653566
<contextData enabled="false" include="" exclude="" />
3567+
<labels enabled="false" exclude="" />
35663568
</forwarding>
35673569
<localDecorating enabled="false" />
35683570
</applicationLogging>
@@ -3579,6 +3581,8 @@ NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CONTEXT_DATA_INCLUDE="myCustomAttribute
35793581
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CONTEXT_DATA_EXCLUDE="myCustomAttribute2, myOtherCustomAttributeMoreSpecificName"
35803582
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED=10000
35813583
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_LOG_LEVEL_DENYLIST="debug, warn"
3584+
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_ENABLED=true
3585+
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_EXCLUDE="label1, label2"
35823586
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=true
35833587
```
35843588

@@ -3661,6 +3665,17 @@ The `applicationLogging` element supports the following attributes and sub-eleme
36613665
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).
36623666
</Collapser>
36633667

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+
36643679
<Collapser
36653680
id="localDecorating"
36663681
title="Local log decoration"
@@ -3870,4 +3885,4 @@ For .NET Core apps, you can configure the following settings in `appsettings.jso
38703885

38713886
<Callout variant="important">
38723887
For [ASP.NET Core apps](https://asp.net/), the .NET Agent will read from `appsettings.{environment}.json` if you set the `ASPNETCORE_ENVIRONMENT` variable.
3873-
</Callout>
3888+
</Callout>

0 commit comments

Comments
 (0)