Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Troubleshooting With .NET Agent Log Files


#1

Is this post relevant to your situation?

This post assumes that you have installed the .NET Framework agent or .NET Core agent and the agent is generating current log files when restarting your application and/or IIS. If your agent is not generating current log files when you restart your application, please start with the posts on troubleshooting installation issues for either the <.NET Framework> or <.NET Core> agent. By default, the .NET Framework agent logs to C:\ProgramData\New Relic\.NET Agent\Logs. The .NET Core agent creates a logs directory in the folder where the agent was extracted on the system (often /usr/local/newrelic-netcore20-agent/logs in linux environments)

Getting the lay of the land

The first thing to understand about the .NET agent (Framework or Core) logs is that there are two kinds of logs: Profiler logs and Agent logs

Profiler logs:

  • Profiler logs get generated every time a compatible and correctly configured .NET process starts up on the system.
  • They have the format NewRelic.Profiler.<process ID>.log.
  • There will be a separate log for each qualifying process ID that starts on your system.
  • The profiler checks the process environment and agent configuration to answer questions like “Should this application be monitored?”, “Is the process/environment supported by the agent?”. and “What instrumentation is in place to monitor this application?”

Agent logs:

  • These logs are generated only after the Profiler decides that the process meets the requirements for monitoring.
  • They have the format newrelic_agent_.<process info>.log
  • There is one log per process. If the process is restarted new data is appended to the end of the agent log file.
  • This log contains information about what happens when the agent actually attempts to monitor your application.

Starting Fresh

Before we dive in to troubleshooting with the agent logs, lets make sure we have a clean slate and are working with fresh data. So, do the following:

  1. Remove all current files from the agent logs folder. You can either delete them, or move them elsewhere if you’d like to keep them.
  2. Restart your application (or IIS if you’re trying to monitor an IIS-hosted application).
  3. Generate some traffic/activity in your application for at least 1 minute.
  4. Identify the process ID of your application’s currently running process.
  5. Check your New Relic account after 5 minutes to see if data is reporting.

What type(s) of logs do you have?

  • No logs at all - You have an installation issue. Please see the installation troubleshooting guide for the agent you’re using. <.NET Framework agent> OR <.NET Core agent>

  • Only Profiler logs - The profiler is recognizing .NET processes starting up on your system, but either making the determination that it should not be monitored, finding no instrumentation present to define HOW to monitor it, or running into a configuration/compatibility error.

  • Profiler and agent logs - The agent saw the application process start up on the system, determined it should be monitored and bootstrapped the agent to attempt to monitor the application.

Find the profiler log for your application

You should have already identified the process ID the application is running under. Now, find the profiler log that corresponds to that process ID. The log should be named NewRelic.Profiler.<process ID>.log. We’ll get in to the “meat” of the file in a bit, but for now, just make sure that it exists, since you want to make sure you’re looking at the log that actually corresponds to the process you’re trying to monitor.

If no profiler log exists for the process ID your app is running under, either the app’s environment is not configured to allow the agent to attach to it, or the app itself is not recognized by the agent as a .NET application. In either case, please refer to the links provided in the “Is this post for you?” section at the top of this post.

I’ve got the profiler log, now what?

If you’re only getting profiler logs - Head over to <Common .NET Agent Profiler Log Issues> to troubleshoot the profiler logs.

If you’re getting both profiler and agent logs:

  • Find the agent log that contains the string “started (pid <your_process_ID>)”, making sure to replace <your_process_ID> with the actual PID of your process. For example: if your application is running under PID 2531, search your agent files for the string “started (pid 2531)”.

  • If no agent log files contain that string, go over to <Common .NET Agent Profiler Log Issues>.

  • If you found both the profiler and agent logs that correspond to your application, then for now go ahead and reach out to support, or ask your specific question in these forums. I’ll be expanding these posts in the future to include common issues in the agent logs.


Relic Solution: Profiler log says ".NET Framework 4.5 is required"
Relic Solution: Profiler Log Says "Exception thrown while attempting to parse configuration file"
Relic Solution: Profiler log says "This application pool (<APP_POOL_ID>) is not explicitly configured to be instrumented or not but application pools are set to be disabled by default"
Relic Solution: Profiler Log Says "This process (. . .) is not configured to be instrumented."