Skip to content

Commit

Permalink
Minor tweak in ProcessIdEnricher
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed May 30, 2023
1 parent 75cef9d commit 6cbcaad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Agent/NewRelic/Agent/Core/Logging/ProcessIdEnricher.cs
Expand Up @@ -11,9 +11,11 @@ namespace NewRelic.Agent.Core
[NrExcludeFromCodeCoverage]
internal class ProcessIdEnricher : ILogEventEnricher
{
private static int _pid = new ProcessStatic().GetCurrentProcess().Id;

public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("pid", new ProcessStatic().GetCurrentProcess().Id));
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("pid", _pid));
}
}
}

0 comments on commit 6cbcaad

Please sign in to comment.