All you have to do is modify your newrelic.ini file as follows:
- Uncomment the line:
log_file = /tmp/newrelic-python-agent.log
- Then set the log_level setting to
debug
- Underneath the log_level line, add the following:
debug.log_data_collector_payloads = True debug.log_agent_initialization = True debug.log_data_collector_calls = True debug.log_transaction_trace_payload = True debug.log_thread_profile_payload = True debug.log_raw_metric_data = True
- Restart your application that loads the New Relic agent.
tail -f /tmp/newrelic-python-agent.log
As you might have guessed, this will create a large log file, so make sure to turn off these settings when you are done with them (or ensure that you are properly rotating your logs).According to New Relic support, the
debug.log_data_collector_payloads
setting is what will log every data message sent to the New Relic collector. As this data is encoded and compressed, the other settings above are what decode the data and print them out in human readable form.If you are not seeing any logging output in your log file, make sure that you are not running into any issues due to logger conflicts. For example, if you disable existing loggers in your app, you won't see any output. For further details take a look at this article put together by the folks at NewRelic.
No comments:
Post a Comment