Skip to content

Commit

Permalink
chore(logs in context) - update .NET config snippets
Browse files Browse the repository at this point in the history
Updated .NET config snippets to be more complete/transparent.
  • Loading branch information
mnevilleoneill committed May 9, 2022
1 parent 03d6463 commit b0d7f34
Showing 1 changed file with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,20 @@ You have three options to configure APM logs in context to send your app's logs

```
<applicationLogging enabled="true">
<forwarding enabled="true" />
<forwarding enabled="true" maxSamplesStored="10000" />
<localDecorating enabled="false" />
</applicationLogging>
```
Environment variable:

This option can also be enabled by setting the environment variable `NEW_RELIC_APPLICATION_LOGGING_FOWARDING_ENABLED=true`. The environment variable value, if present, takes precedence over the config file value.
```
NEW_RELIC_APPLICATION_LOGGING_ENABLED=true
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=true
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED=10000
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=false
```

Note: The environment variable value, if present, takes precedence over the config file value.

This option may be on by default in a future agent version.

Expand All @@ -73,10 +82,19 @@ You have three options to configure APM logs in context to send your app's logs
```
<applicationLogging enabled="true">
<forwarding enabled="true" maxSamplesStored="10000" />
<localDecorating enabled="false" />
</applicationLogging>
```

This setting can also be adjusted by setting the environment variable `NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED`. The environment variable value, if present, takes precedence over the config file value.

Environment variable:

```
NEW_RELIC_APPLICATION_LOGGING_ENABLED=true
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=true
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED=10000
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=false
```
Note: The environment variable value, if present, takes precedence over the config file value.

If you have an existing log forwarding solution and are updating your agent to use automatic logs in context, be sure to **disable your manual log forwarder**. Otherwise, your app will be sending double log lines. Depending on your account, this could result in double billing. For more information, follow the procedures to disable your [specific log forwarder](/docs/logs/forward-logs/enable-log-management-new-relic#log-forwarding).

Expand All @@ -101,11 +119,19 @@ You have three options to configure APM logs in context to send your app's logs

```
<applicationLogging enabled="true">
<forwarding enabled="false" />
<localDecorating enabled="true" />
</applicationLogging>
```

Environment variable:

This option can also be enabled by setting the environment variable `NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=true`. The environment variable value, if present, takes precedence over the config file value.
```
NEW_RELIC_APPLICATION_LOGGING_ENABLED=true
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=false
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=true
```
Note: The environment variable value, if present, takes precedence over the config file value.

Our decorator adds five attributes to every log message: `entity.guid`, `entity.name`, `hostname`, `trace.id`, and `span.id`. Example:

Expand Down

0 comments on commit b0d7f34

Please sign in to comment.