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:
- Open
newrelic.config
, usually located inC:\ProgramData\New Relic\.NET Agent
(or%ALLUSERSPROFILE%\New Relic\.NET Agent
). - Change the
<log level="info" />
setting to<log level="debug" />
. - Save and close the file, then wait a few minutes for the agent to read the new settings.
- Generate a few minutes of traffic to your app.
- 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 entireLogs
folder fromC:\ProgramData\New Relic\.NET Agent\Logs
or from%ALLUSERSPROFILE%\New Relic\.NET Agent\Logs
. - 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
.
- Open
newrelic.config
, usually located in/usr/local/newrelic-dotnet-agent
- Change the
<log level="info" />
setting to<log level="debug" />
. - Save and close the file, then wait a few minutes for the agent to read the new settings.
- Generate a few minutes of traffic to your app.
- 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 entireLogs
folder from/usr/local/newrelic-dotnet-agent/logs
. - 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.
Navigate to the URL of your Azure Web app; for example:
https://example.azurewebsites.netInsert the Kudu Console URL
scm
snippet into the URL; for example:https://example.scm.azurewebsites.netCheck 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:
- From the Kudu Console navigation bar, select the Debug console menu, then select either CMD or PowerShell.
- Navigate to
D:\home\site\wwwroot\newrelic
. - To edit
newrelic.config
, select the pencil icon. - Change
<log level="info">
to<log level="debug">
- Save the change to
newrelic.config
. - Wait a few minutes for the debug logs to be generated.
- Use the same steps to switch the
log level
back toinfo
.
Collect system information
In addition to agent logs, a Microsoft System Information file is also useful for troubleshooting:
- From the Windows task bar, select Start > Run and enter
msinfo32
. Select OK. - After the system information page loads, select File > Save.
- Wait a few minutes for the server to save the file.
- 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.