Skip to content

Commit

Permalink
feat(logs in context for go): add new documents
Browse files Browse the repository at this point in the history
  • Loading branch information
iamemilio committed Jun 23, 2022
1 parent fc9fd88 commit 0104a14
Show file tree
Hide file tree
Showing 3 changed files with 353 additions and 14 deletions.
Expand Up @@ -1972,3 +1972,206 @@ To enable Infinite Tracing, enable distributed tracing (set `config.DistributedT
For help getting a valid Infinite Tracing trace observer host entry, see [Find or create a trace observer endpoint](/docs/understand-dependencies/distributed-tracing/enable-configure/language-agents-enable-distributed-tracing#provision-trace-observer).
</dd>
</CollapserGroup>

## Application logging settings [#application-logging]

The following settings are available for configuration of application logging in the agent.

<Callout variant="important">
Requires Go agent version 3.17.0 or higher
</Callout>

<CollapserGroup>
<Collapser
id="application-logging-enabled"
title="ApplicationLogging.Enabled"
>
<table>
<tbody>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
`true`
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>
</tbody>
</table>
If `true`, enables the collection of log events and logging metrics if these sub-feature configurations are also enabled. If `false`, no logging instrumentation features are enabled.

Configure ApplicationLogging by calling ConfigAppLogEnabled().

```go
app, err := newrelic.NewApplication(
newrelic.ConfigAppLogEnabled(true),
)
```
</Collapser>

<Collapser
id="application-logging-forwarding-enabled"
title="ApplicationLogging.Forwarding.Enabled"
>
<table>
<tbody>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
`false`
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>
</tbody>
</table>

If `true`, the agent captures log records emitted by your application and forwards them to New Relic. `ApplicationLogging.Enabled` must also be `true` for this setting to take effect.

Enable log forwarding by calling ConfigAppLogForwardingEnabled().

```go
app, err := newrelic.NewApplication(
newrelic.ConfigAppLogForwardingEnabled(true),
)
```
</Collapser>

<Collapser
id="application-logging-forwarding-maximum-samples-stored"
title="ApplicationLogging.Forwarding.MaxSamplesStored"
>
<table>
<tbody>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
10000
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>

</tbody>
</table>

Number of log records to send per minute to New Relic. This setting controls overall memory consumption when using the log forwarding feature.

Configure ApplicationLogging.Forwarding.MaxSamplesStored by calling ConfigAppLogForwardingMaxSamplesStored().

```go
app, err := newrelic.NewApplication(
newrelic.ConfigAppLogForwardingMaxSamplesStored(1000),
)
```

</Collapser>

<Collapser
id="application-logging-metrics-enabled"
title="ApplicationLogging.Metrics.Enabled"
>
<table>
<tbody>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
`true`
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>
</tbody>
</table>

If `true`, the agent captures metrics related to the log lines being sent up by your application. `ApplicationLogging.Enabled` must also be `true` for this setting to take effect.

Configure ApplicationLogging.Metrics.Enabled by calling ConfigAppLogMetricsEnabled().

```go
app, err := newrelic.NewApplication(
newrelic.ConfigAppLogConfigAppLogMetricsEnabled(true),
)
```
</Collapser>
</CollapserGroup>

0 comments on commit 0104a14

Please sign in to comment.