NLog 5.1.3 structured logs are not enriched by agent for APM Logs with Context #1609
Labels
community
To tag external issues and PRs
feature request
To tag an issue after triage that is a feature instead of TD
Description
I just updated NLog from version 4.7.15 to 5.1.3 and noticed that some of my logs are no longer enriched for APM Logs with Context by the agent (eg no entity.guid).
Some structured NLog logs (https://github.com/NLog/NLog/wiki/How-to-use-structured-logging#using-structured-logging) are no longer enriched by the APM agent and accordingly cannot be traced. Sample log format:
_logger.LogDebug("Start Request: {request}", request);
Also many logs from System and Microsoft which has variable context are no longer enriched. Sample:
Hosting environment: Development
from loggerMicrosoft.Hosting.Lifetime
.Expected Behavior
The logs that were enriched with NLog 4.7.15 shall be enriched with NLog 5.1.3.
Steps to Reproduce
Write structured NLog (https://github.com/NLog/NLog/wiki/How-to-use-structured-logging#using-structured-logging) like:
_logger.LogDebug("Start Request: {request}", request);
Your Environment
.NET 6
NLog 5.1.3
NLog.Extensions.Logging 5.2.3
NLog.Web.AspNetCore 5.2.3
Microsoft.Extensions.Logging 6.0.0
NewRelic.Agent 10.10.0
NLog config:
Docker build file:
Additional context
Related to #1459
The text was updated successfully, but these errors were encountered: