This post applies to both the .NET Framework and .NET Core agents.
In this post, we’ll walk through the steps involved in determining if the .NET agent is generating current logs for your application. This is usually the first step when troubleshooting an agent that is not reporting to your New Relic account.
First, find the agent logs directory.
Now, Make sure you’re looking at current data. Delete or move any existing files in the logs directory so that you’re sure the logs you will generate reflect the current state of your system.
Restart your application or, if your application runs in IIS, issue a command-line
Exercise your application for at least one minute in a way that would generate traffic you’d expect to see in your New Relic account.
Make note of the process ID (PID) your application is running under so you can verify if a log is being created for that process.
Go back to the agent logs directory and look for a log file with a name containing the process ID of your application
If you see that “profiler log” file in the logs directory, then also check to see if there is a corresponding “agent” log.
Look for another file with the prefix
newrelic_agent. There may be more than one of these if you’re running multiple .NET applications on your server. If you see one or more, open it/them up to make sure you have one that actually corresponds to the application you’re trying to monitor.
Search in the agent log for the string
(pid [your PID]), replacing
[your pid]as appropriate. For example
(pid 1573). If you find that string in the log file, then you know it is the “agent log” associated with your application.
Did you know?
The “profiler log” is associated with the part of the agent that detects processes starting up on the system, determines if they should be monitored, and if so, which portions of the application to monitor. The “agent log” represents the ongoing activity of an agent that is actively monitoring an application.
You can have a profiler log and not an agent log, but you’ll never have an agent log without a corresponding profiler log.