---
title: Log (audit) all data your New Relic agent transmits
source: https://docs.newrelic.com/docs/new-relic-solutions/solve-common-issues/troubleshooting/log-audit-all-data-your-new-relic-agent-transmits
---

Every New Relic agent includes strong safeguards to ensure [data security](https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/data-security). For example, New Relic automatically encrypts sensitive information before it is transmitted. For more information about New Relic's security measures, see our [security and privacy documentation](https://docs.newrelic.com/docs/using-new-relic/new-relic-security/security/security-matters-data-privacy-new-relic), or visit the [New Relic security website](https://newrelic.com/security).

If you need to record and view information about **all** data your app transmits to New Relic, you can enable audit logging for short periods of time. This is useful, for example, with debugging or auditing, when you need detailed information about what exactly is being transmitted.

> #### ⚠️ CAUTION
>
> Be sure to disable audit logging as soon as you are finished using it. This feature causes additional overhead, which may overload the audit log file if left turned on for extended periods of time.

## APM agent audit logging [#audit-logging]

For details about the audit logging options for your APM agent's configuration file, see the agent-specific documentation:

| **Agent** | **Configuration file**                                                                                                                                                                                                                                                                                                                           |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Go        | Logging is optional with the Go agent. If you are using `newrelic.NewLogger(w)` and want more detailed output, change `newrelic.NewLogger(w)` to `newrelic.NewDebugLogger(w)`. For more information, see the [New Relic Go logging documentation on GitHub](https://github.com/newrelic/go-agent/blob/master/v3/newrelic/log.go).                |
| Java      | Set [`audit_mode`](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file#cfg-audit_mode) to `true`.                                                                                                                                                                                                |
| .NET      | Set [`auditLog`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#log-auditLog) to `true`.                                                                                                                                                                                                     |
| Node.js   | New Relic's Node.js agent does not use separate audit logs because the payload is already available in the configuration logs. To view increasing levels of detail, use your config file's [logging `level` variables](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#logging_config). |
| PHP       | Use PHP [`newrelic.daemon.auditlog` (for `newrelic.ini`)](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-daemon-auditlog) or [`auditlog` (for `newrelic.cfg`)](https://docs.newrelic.com/docs/agents/php-agent/configuration/proxy-daemon-newreliccfg-settings#cfgvar-auditlog).                   |
| Python    | Use Python [`audit_log_file` values](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#audit-log-file).                                                                                                                                                                                   |
| Ruby      | Use [`audit_log` values](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#audit-log). For more information, see [Ruby agent audit log](https://docs.newrelic.com/docs/agents/ruby-agent/troubleshooting/ruby-agent-audit-log).                                                                       |

## Infrastructure agent logging [#infrastructure-logging]

You can [generate infrastructure monitoring logs](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/generate-logs-troubleshooting-infrastructure) for troubleshooting our infrastructure agent.

## New Relic account-related logging [#account-logging]

To audit changes to your New Relic account, run NRQL queries with [`NrAuditEvent`](https://docs.newrelic.com/docs/insights/use-insights-ui/manage-account-data/query-account-audit-logs-nrauditevent). To customize your query, use any of the available [`NrAuditEvent` attributes](https://docs.newrelic.com/docs/insights/insights-data-sources/default-data/nrauditevent-default-attributes-examples).
