• /
  • Log in
  • Free account

Generate logs for troubleshooting the infrastructure agent

Problem

When troubleshooting your infrastructure agent, generate verbose logs for a few minutes to find and investigate errors. This can be useful for your own troubleshooting or when working with New Relic Support.

Important

Verbose logging generates a lot of data very quickly. When finished generating logs, be sure to set verbose: 0 to reduce disk space consumption.

If you have New Relic infrastructure agent 1.4.0 or higher, you can automate this process by using the newrelic-infra-ctl command. For more information, see the troubleshooting binary documentation.

Solution

Generating verbose log files requires editing your configuration file. For a sample config file that includes all applicable settings, see the example template. To generate detailed logs:

Step

Procedures

Edit your newrelic-infra.yml file:

  1. Enable verbose logging: verbose: 1. (If you use a containerized infrastructure agent on CoreOS, see system-specific notes.)
  2. Set log_file to a convenient log file location.
  3. Restart the agent so the agent notices the new settings.

Let your host run at normal load for about three minutes to generate sufficient logging data.

Return your settings to default:

  1. Disable verbose logging by setting verbose: 0 in newrelic-infra.yml.
  2. Optional: Disable logging to a custom file by removing the log_file line from newrelic-infra.yml.
  3. Restart the agent so the agent notices the new settings.

Examine the log file for errors.

If you need to send your log file to New Relic Support:

  1. Include the line in your log file that contains the agent version:

    New Relic infrastructure agent version X.YY.ZZZ
  2. Attach the log file to your support ticket, along with your newrelic-infra.yml.

Smart verbose mode

Sometimes errors don't occur until after quite some time has passed. This makes debugging difficult, because typically verbose logs are only enabled for a short period time; otherwise there will be many debug logs. For example, if an error occurs one hour after the infrastructure agent has started, getting debug logs around the time of the error can be tricky or impractical.

As of infrastructure agent v1.9.0 or higher, you can use smart verbose mode for logs. Smart verbose mode only logs the most recent debug messages after an error has been logged. This allows you to leave smart verbose mode running until an error occurs, without logging lots of irrelevant debug messages, and only logging the most recent debug messages. (The number of messages is determined by your configuration.)

For more information on smart verbose mode, see the Infrastructure agent logging behavior docs, and use the Infrastructure configuration settings documentation for details on how to enable smart verbose mode.

Forward the agent logs to New Relic Logs

The Infrastructure agent can be configured to send its own logs to New Relic Logs. This can be useful for troubleshooting issues with log forwarding, the Infrastructure agent, or when contacting support.

For details on how to enable log forwarding for the Infrastructure agent, see Troubleshoot log forwarding.

Notes for specific systems

These are some additional notes and requirements for specific systems, used to supplement the general logging instructions:

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.