Closed ejsolberg closed 2 months ago
Running against the latest agent version v3.34.0
w/ Logrus LogsInContext configured (doc)
Related to new functionality added in Capture Log Attributes in the Agent https://github.com/newrelic/go-agent/pull/900 Using Logrus attributes https://github.com/newrelic/go-agent/pull/937
Currently, when errors are logged with the Logs in Context integration, the type is emitted instead of the error string.
log.WithError(fmt.Errorf("this is the error message")).Error("Something went wrong")
Console output:
{"error":"this is the error message","level":"error","msg":"Something went wrong"}
NewRelic Log:
{"error":"*errors.errorString","level":"error","msg":"Something went wrong"}
This change aligns the NewRelic log attribute with the console output
All committers have signed the CLA.
Hi, thanks for this contribution! Can you rebase it against develop? That is where we stage all of our commits. Otherwise, it looks good!
Hi @iamemilio, thanks for the initial review! I've rebased to develop
develop
Links
Running against the latest agent version v3.34.0
w/ Logrus LogsInContext configured (doc)
Related to new functionality added in Capture Log Attributes in the Agent https://github.com/newrelic/go-agent/pull/900 Using Logrus attributes https://github.com/newrelic/go-agent/pull/937
Details
Currently, when errors are logged with the Logs in Context integration, the type is emitted instead of the error string.
Console output:
NewRelic Log:
This change aligns the NewRelic log attribute with the console output