Skip to content

Commit

Permalink
fix: Path to agentinfo.json was built incorrectly, leading to file no…
Browse files Browse the repository at this point in the history
…t found errors when running on Linux. #2156
  • Loading branch information
tippmar-nr committed Dec 20, 2023
1 parent b392701 commit b7f4a1c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Agent/NewRelic/Agent/Core/AgentInstallConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,21 @@ private static string GetNewRelicLogLevel()

public static AgentInfo GetAgentInfo()
{
var agentInfoPath = $@"{NewRelicHome}\agentinfo.json";
var agentInfoPath = Path.Combine(NewRelicHome, "agentinfo.json");

if (File.Exists(agentInfoPath))
{
try
{
return JsonConvert.DeserializeObject<AgentInfo>(File.ReadAllText(agentInfoPath));
}
catch
catch (Exception e)
{
// Fail silently
Log.Debug(e, $"Could not get agent info from {agentInfoPath}.");
}
}

Log.Debug($"Could not get agent info from {agentInfoPath}. File does not exist.");
return null;
}
}
Expand Down

0 comments on commit b7f4a1c

Please sign in to comment.