---
title: Generate debug logs for troubleshooting (Java)
source: https://docs.newrelic.com/docs/apm/agents/java-agent/troubleshooting/generate-debug-logs-troubleshooting-java
---

When troubleshooting your New Relic Java agent, generate `finest` logs to find and investigate errors. When finished troubleshooting, be sure to set the log file back to a less verbose setting, such as `info`.

## Requirements [#requirement]

If you only change the log file setting in your `newrelic.yml` file, you do not need to restart the server or JVM. However, if you make any other changes, you **must** restart your server or JVM.

Be sure you keep the original line indentation in your `newrelic.yml` file. YAML is "space sensitive" and requires proper indentation.

The `audit_mode` setting (when set to `true` ) will also log communication between the Java agent and New Relic to the log file. New Relic Support may occasionally request [audit mode logs](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/log-audit-all-data-your-new-relic-agent-transmits) for additional troubleshooting.

## Generate log files [#finer]

To generate detailed `finest` log files:

1.  Edit your `newrelic.yml` file, and change the [`log_level`](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file#cfg-log_level) to `finest`. Be sure to keep these lines [indented **two spaces**](#requirements).

    ```yaml
    # The agent uses its own log file to keep its logging
    # separate from that of your application. Specify the log level here.
    # This setting is dynamic, so changes do not require restarting your application.
    # The levels in increasing order of verboseness are:
    # off, severe, warning, info, fine, finer, finest
    # Default is info.
    log_level: finest

    # Log all data sent to and from New Relic in plain text.
    # This setting is dynamic, so changes do not require restarting your application.
    # Default is false.
    audit_mode: false
    ```
2.  Exercise your web application for about five minutes to generate sufficient logging data.
3.  After testing, change the [`log_level`](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file#cfg-log_level) to a less verbose level, such as `info` (default).
4.  Open your log files and examine them for errors.

## Examine log files [#logfile]

> #### ⚠️ IMPORTANT
>
> The `finest` log setting is a highly verbose logging level. To reduce disk space consumption after testing, return the `log_level` to its original setting.

By default, log files are stored in a `logs` sub-directory, inside the same directory as `newrelic.jar`. If necessary, follow the [troubleshooting procedures if no log files appear](https://docs.newrelic.com/docs/agents/java-agent/troubleshooting/no-log-file-java).
