Skip to content

Commit

Permalink
Add env var config options for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nr-ahemsath committed Apr 11, 2022
1 parent b8861b8 commit 803dd42
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3105,6 +3105,16 @@ For more details, see our documentation about [APM logs in context](/docs/apm/ne
</applicationLogging>
```

These features can also be configured via environment variables:

```
NEW_RELIC_APPLICATION_LOGGING_ENABLED="true"
NEW_RELIC_APPLICATION_LOGGING_METRICS_ENABLED="true"
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED="false"
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED="10000"
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED="false"
```

<Callout variant="important">
This configuration option is only available in the .NET agent v9.7.0 or higher.
</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ You have three options to configure APM logs in context to send your app's logs
</applicationLogging>
```

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.

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

**Optional adjustments:**
Expand All @@ -75,6 +77,8 @@ You have three options to configure APM logs in context to send your app's logs
<logForwarding enabled="true" maxSamplesStored="10000" />
</applicationLogging>
```

This setting can also be adjusted by setting the environment variable `NEW_RELIC_APPLICATION_LOGGING_FOWARDING_MAX_SAMPLES_STORED`. 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 old 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 @@ -99,6 +103,8 @@ You have three options to configure APM logs in context to send your app's logs
</applicationLogging>
```

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.

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 803dd42

Please sign in to comment.