Generating logs for troubleshooting (Python)

Detailed debug logging can help troubleshoot your standard Python agent installation.

To enable debug logging:

  1. Open your newrelic.ini, usually located within your app hierarchy.
  2. Uncomment #log_file = /tmp/newrelic-python-agent.log. Ensure you have write permissions to the log location, changing the path and file name if necessary. If there is no suitable file location, you can set log_file to stderr.

  3. Change log_level to debug (from info).

    Logging at debug can generate a lot of data very quickly. Monitor the size of your log file closely, changing log_level back to info as you finish troubleshooting.

  4. Save and close the file. Restart your app for the settings to take effect.

  5. Generate a few minutes of traffic to your app.

  6. If sending your log file to New Relic Support, attach your newrelic.ini to your support ticket, and tell Support your time zone.

For more help

Additional documentation resources include:

Join the discussion about Python 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