• /
  • EnglishEspañol日本語한국어Português
  • Log inStart now

Automatically detect browser logs

Auto logging collects log messages issued from the browser console to help you maximize observability of your front-end applications.

Browser logs are tracked by default at the WARN level for Pro and Pro+SPA agents, but unavailable for the Lite browser agent. We recommend that you first confirm you're using the Pro or Pro+SPA agent. See Getting Started.

How browser auto-logging works

Based on logging levels and sampling rates set in the configuration, auto-instrumentation of browser logs will attempt to collect messages from the following methods:

Method

Level

console.log

'INFO'

console.error

'ERROR'

console.warn

'WARN'

console.info

'INFO'

console.debug

'DEBUG'

console.trace

'TRACE'

Important

Data passed through the console methods may go through serialization and obfuscation. 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.

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

Get started

Enable automatic log collection

  1. Go to one.newrelic.com > All Capabilities > Browser.
  2. Select your browser app.
  3. In the left-hand menu, click Application settings.
  4. On the Application settings page, make sure Pro or Pro + SPA browser agent is selected. Automatic log detection is not available for the Lite browser agent.
  5. Toggle ON Browser logs setting.

Configure sampling rates

Set a sampling rate (0%-100%) for the following samples:

  • User sessions records a random sample of all user sessions.

    For example, if you set the session sampling rate to 50%, it means that:

  • Half of all user sessions will automatically collect log events.

View log events

You can find logging data in two places:

  • On the Logs page:

    1. Go to: one.newrelic.com > All capabilities > Logs. For details on what you can do in the UI, see Logs UI.

      You can also query the Log data type. Here's a simple example NRQL query:

      SELECT * FROM Log

      You can also use NerdGraph, our GraphQL-format API to query data, or to configure log management.

  • On the Errors inbox page:

    1. In the left-hand browser menu, click Errors.
    2. Click on the Triage and Group errors pages to see logs attached to errors.

Data consumption

Logs follow the same consumption pricing as your other browser bytes. The amount of bytes produced depends on the count and length of messages.

The auto logging feature eliminates the need to call the newrelic.log or newrelic.wrapLogger browser APIs, except when adding custom attributes to logging events.

Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.