Browser logs are included with the Pro and Pro+SPA browser agent. Read the docs
Checking for browser agent…
New Relic browser monitoring

Your browser,
logged.

Click around this page to send real log events to a shared New Relic account, then find your own messages with a single query.

This app collects WARN logs and above, which is the default. Buttons marked filtered show what happens to lower levels like console.log.
// 1. Console calls are captured automatically
console.error('Payment declined')

// 2. Or send a log yourself, with attributes
newrelic.log('Cart abandoned', {
  level: 'warn',
  customAttributes: { cartValue: 129.99 }
})

// 3. Or wrap the logger you already have
newrelic.wrapLogger(myLogger, 'warn', {
  level: 'warn'
})
Your data is tagged as … NR-XXXX Change

Everyone shares one New Relic account, so we tag your logs. Your name and session code are attached to every log as demoUser and demoCode, your name also becomes your end-user ID via newrelic.setUserId(), and the code is added to the start of each message.

Write this code down. You will search for NR-XXXX in the queries further down. It stays the same on every page until you click New code or close this tab.

Try it / Generate events

Make some logs

There are three ways to get browser logs into New Relic, plus a few realistic scenarios. Each button shows the log level it creates and whether that level is kept at WARN.

Method 1 · Automatic

Console auto-logging

The agent watches the browser console. No code changes needed, just turn on Automatically collect console logs in Application settings.

Method 2 · API

newrelic.log()

Send one log event with a level you choose and your own attributes.


            
Method 3 · Wrap your logger

newrelic.wrapLogger()

This page has its own little logger, appLogger, which writes to the box below and not to the console. Each method was wrapped once at page load, so every call also becomes a New Relic log event. The first argument becomes the message.

// Run once at page load
newrelic.wrapLogger(appLogger, 'info',  { level: 'info',  customAttributes: { loggerName: 'appLogger' } })
newrelic.wrapLogger(appLogger, 'warn',  { level: 'warn',  customAttributes: { loggerName: 'appLogger' } })
newrelic.wrapLogger(appLogger, 'error', { level: 'error', customAttributes: { loggerName: 'appLogger' } })
Real-world scenarios

What your users actually hit

Each scenario plays out a short story using a mix of all three methods, with attributes you could filter or facet on.

Find it / Search the shared account

Find your logs

Browser logs are sent in batches, so allow up to a minute for new events to show up. Both searches below are already filled in with your code, NR-XXXX.

Option A: Logs UI

  1. Open New Relic and go to Logs.
  2. Paste this into the search bar and press Enter.

          
Open Logs

Option B: NRQL query

  1. Open the query builder in New Relic.
  2. Paste and run this query.

          
Open New Relic
Missing INFO or DEBUG logs?That is the verbosity filter at work. This app keeps WARN and above. Change it under Browser > Application settings.
Console logs not showing?Check that Automatically collect console logs is on, and for API and wrapped logs, that Collect logs manually is on.