Generate trace log for troubleshooting (Node.js)

Your New Relic Node.js agent log captures errors at the default info level. However, when troubleshooting or debugging, generate a more verbose trace log to help find and investigate problems.

The trace log setting is a highly verbose logging level. To reduce disk space consumption, return the logging : { section's level to its original setting after testing.

Generate log files

To generate the detailed trace log file:

  1. Edit your newrelic.js file and change the logging section's level to trace.

    logging: {
        level: 'trace'
      }
  2. Restart Node.
  3. Exercise your web application for about five minutes to generate sufficient logging data.
  4. After testing, change the level to a less verbose logging level, such as info (default).
  5. Open and examine the generated log file.

Examine log file

By default, the Node.js agent stores the log file in the current working directory as newrelic_agent.log. If the log file or folder are not visible:

  1. Check whether you have set the logging path to stdout or stderr.
  2. Verify that the current working directory is the same as the directory where you expect the log file to be located.

For more help

Additional documentation resources include the Node.js agent's Troubleshooting section.

Join the discussion about Node.js monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

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