• English日本語한국어
  • Log inStart now

Generate logs for troubleshooting (.NET)

New Relic's .NET agent by default stores two types of log files in the Logs directory at %ALLUSERSPROFILE%\New Relic\.NET Agent\Logs for Windows and at /usr/local/newrelic-dotnet-agent/logs for Linux. If you are using a NuGet package install, they will be located in the newrelic folder within your app's root directory. Both are needed for troubleshooting; for example, if no data appears in the New Relic UI for your app. If either log type is missing, some component of the .NET agent did not start.

  • Agent logs: These file names begin with newrelic_agent_.
  • Profiler logs: These file names begin with NewRelic.Profiler.

Generate log files in Windows

Important

When troubleshooting your New Relic .NET agent, ensure it has been configured to generate debug level log files, and monitor the size of your log file closely. Logging at debug generates a lot of data very quickly. After reproducing your problem, return the log level to info.

If your C:\ProgramData\New Relic\.NET Agent is in a hidden folder, update your Windows settings so that you can see it. To generate New Relic for .NET log files:

  1. Open newrelic.config, usually located in C:\ProgramData\New Relic\.NET Agent (or %ALLUSERSPROFILE%\New Relic\.NET Agent).
  2. Change the <log level="info" /> setting to <log level="debug" />.
  3. Save and close the file, then wait a few minutes for the agent to read the new settings.
  4. Generate a few minutes of traffic to your app.
  5. If sending your log file to New Relic Support: In your New Relic support ticket, attach the newrelic.config file (not the text of the file), and attach the entire Logs folder from C:\ProgramData\New Relic\.NET Agent\Logs or from %ALLUSERSPROFILE%\New Relic\.NET Agent\Logs.
  6. In newrelic.config, change <log level="debug" /> to <log level="info" />.

Generate log files in Linux

Important

When troubleshooting your New Relic .NET agent, ensure it has been configured to generate debug level log files, and monitor the size of your log file closely. Logging at debug generates a lot of data very quickly. After reproducing your problem, return the log level to info.

  1. Open newrelic.config, usually located in /usr/local/newrelic-dotnet-agent
  2. Change the <log level="info" /> setting to <log level="debug" />.
  3. Save and close the file, then wait a few minutes for the agent to read the new settings.
  4. Generate a few minutes of traffic to your app.
  5. If sending your log file to New Relic Support: In your New Relic support ticket, attach the newrelic.config file (not the text of the file), and attach the entire Logs folder from /usr/local/newrelic-dotnet-agent/logs.
  6. In newrelic.config, change <log level="debug" /> to <log level="info" />.

Generate Azure Web App log files

Kudu Console manages Microsoft Azure Web App log reporting. To use the Kudu Console, first log into Azure.

  1. Navigate to the URL of your Azure Web app; for example:

    https://example.azurewebsites.net
  2. Insert the Kudu Console URL scmsnippet into the URL; for example:

    https://example.scm.azurewebsites.net
  3. Check for the Kudu logo with a black navigation bar at the top left of the page and your Azure username at the top right of the page.

Then, to change the log level within the Kudu Console:

  1. From the Kudu Console navigation bar, select the Debug console menu, then select either CMD or PowerShell.
  2. Navigate to D:\home\site\wwwroot\newrelic.
  3. To edit newrelic.config, select the pencil icon.
  4. Change <log level="info"> to <log level="debug">
  5. Save the change to newrelic.config.
  6. Wait a few minutes for the debug logs to be generated.
  7. Use the same steps to switch the log level back to info.

Collect system information

In addition to agent logs, a Microsoft System Information file is also useful for troubleshooting:

  1. From the Windows task bar, select Start > Run and enter msinfo32. Select OK.
  2. After the system information page loads, select File > Save.
  3. Wait a few minutes for the server to save the file.
  4. Attach the file to your New Relic support ticket.

Check permissions

Sometimes the .NET agent will start but not be able to write to its logs because it does not have the necessary permissions to create the log directory and log files. Permissions management varies by environment, so you will need to work with your system administrator to verify that this is not an issue.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.