Viewing detailed error logs in the browser

Problem

You want to use your browser's console to view detailed error messages from your development or staging environment, but when New Relic Browser is active, your browser's console doesn't display detailed error traces.

Cause

New Relic Browser must capture and re-throw errors in order to record them, but some browser versions don't display stack traces for re-thrown errors.

Solution

Enable New Relic Browser's development mode in your local browser. New Relic Browser agent versions 593 or higher include a workaround for this behavior that can be enabled in the console. The following instructions are for Chrome, but you can adapt them for other browsers.

  1. In Chrome, select the menu icon, and then select More tools > JavaScript Console.
  2. From the JavaScript console, set the following value for nr_flags in local storage:

    localStorage.setItem('__nr_flags', 'dev')
  3. Refresh the page where you want to see your JavaScript errors. The agent logs NR AGENT IN DEVELOPMENT MODE in the console to confirm development mode is active.

  4. Navigate the site and trigger the errors that you want to track.

To disable development mode, run the following command in the console:

localStorage.removeItem('__nr_flags')

For more help

Additional documentation resources include Upgrading the browser agent (ensuring you have a compatible agent version).

Discuss Browser monitoring in the New Relic Online Technical Community! Troubleshoot and ask questions, or discuss JavaScript error reporting or AJAX timing in detail.

If you need additional help, get support at support.newrelic.com.