Relic Solution: How to Check if the .NET Agent is Generating Logs for Your Application

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.

  1. First, find the agent logs directory.

  2. 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.

  3. Restart your application or, if your application runs in IIS, issue a command-line iisreset.

  4. 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.

  5. 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.

  6. Go back to the agent logs directory and look for a log file with a name containing the process ID of your application

NewRelic.Profiler.[PID].log
  1. If you see that “profiler log” file in the logs directory, then also check to see if there is a corresponding “agent” log.

  2. 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.

  3. 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.

1 Like