Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,48 @@ Based on logging levels and sampling rates set in the configuration, auto-instru

By default, logging data is stored for 30 days, but actual data retention depends on your account.

## Prerequisites
### Prerequisites

* A **Pro** or **Pro + SPA** browser agent
* Browser agent version 1.283.0 or higher:

<table>
<thead>
<tr>
<th style={{width: "200px"}}>
Agent version
</th>
<th>
Configuration behavior
</th>
</tr>
</thead>

<tbody>
<tr>
<td>
`1.283.0 - 1.296.0`
</td>
<td>
Application settings are applied to both console and manual logs
</td>
</tr>
<tr>
<td>
`1.297.0` and above
</td>
<td>
Console logs and manual logs have separate settings for verbosity, sampling, and enable/disable controls
</td>
</tr>
</tbody>
</table>

<Callout variant="important">
Automatic log detection is not available for the Lite browser agent.
</Callout>

## Enable automatic log collection (For Existing Browser Apps) [#enable-automatic-log]
## Enable automatic log collection (For existing browser apps) [#enable-automatic-log]

Enhance your application's observability and debugging capabilities by following these simple setup instructions.

Expand All @@ -118,25 +151,25 @@ Enhance your application's observability and debugging capabilities by following
</Step>

<Step>
Toggle **Browser Logs** to **ON**.
Toggle **Automatically collect console logs** to **ON**.
</Step>

<Step>
Edit the sampling rate to specify the percentage of user sessions to collect logs. You can enter a value between 0 and 100.

<Callout variant="important">
The default sampling rate for browser logging is set to 10% of user sessions. You can set this session sampling rate anywhere between `0%` to `100%`. For example, setting the session sampling rate to `50%` will result in log event collection from approximately half of randomly selected user sessions.
The default sampling rate for browser logging is set to 100% of user sessions. You can set this session sampling rate anywhere between `0%` to `100%`. For example, setting the session sampling rate to `50%` will result in log event collection from approximately half of randomly selected user sessions.
</Callout>
</Step>

<Step>
Toggle the required verbosity level to **ON**, you can choose from:
* **Error**
* **Warn**
* **Info**
* **Debug**
* **Trace**
Toggle the required verbosity level to **ON**. The default verbosity level is set to **WARN**. The levels you can choose from:

* `ERROR`
* `WARN`
* `INFO`
* `DEBUG`
* `TRACE`

<Callout variant="important">
Data passed through the console methods may go through serialization and [obfuscation](/docs/browser/new-relic-browser/configuration/obfuscate-browser-agent-data). Depending on the size and frequency, this may negatively impact application performance as well as data costs. In general, it is NOT recommended to pass in large objects or large amounts of data into console methods.
Expand Down Expand Up @@ -171,7 +204,7 @@ To disable browser logs for an existing browser app:
</Step>

<Step>
Toggle **Browser Logs** to **OFF**.
Toggle **Automatically collect console logs** to **OFF**.
</Step>
</Steps>

Expand Down
43 changes: 42 additions & 1 deletion src/content/docs/browser/new-relic-browser/browser-apis/log.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,48 @@ Captures data as a single log event.

## Requirements [#log-requirements]

* Browser Pro, or Pro+SPA agent (v1.261.0 or higher)
* Browser Pro, or Pro+SPA agent
* Browser agent version 1.283.0 or higher:

<table>
<thead>
<tr>
<th style={{width: "200px"}}>
Agent version
</th>
<th>
Configuration behavior
</th>
</tr>
</thead>

<tbody>
<tr>
<td>
`1.261.0 - 1.282.0`
</td>
<td>
Application settings aren't configurable
</td>
</tr>
<tr>
<td>
`1.283.0 - 1.296.0`
</td>
<td>
Application settings are applied to both console and manual logs
</td>
</tr>
<tr>
<td>
`1.297.0` and above
</td>
<td>
Console logs and manual logs have separate settings for verbosity, sampling, and enable/disable controls
</td>
</tr>
</tbody>
</table>
* If you're using npm to install the browser agent and using a non-standard implementation, you must enable the `logging` feature when instantiating the `BrowserAgent` class. For example, add the following in the`features` array:

```js
Expand Down
Binary file modified static/images/browser-logs-overview.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading