Open
Description
Summary
The current logging by the new relic daemon is unstructured making it difficult to use in log aggregation tooling
Desired Behavior
A configuration option exists to switch the newrelic daemon to structured logging
Possible Solution
There are many golang logging libraries to choose from that support structured logging
Additional context
Ref:
- https://newrelic.com/blog/how-to-relic/structured-logging
- https://kubernetes.io/blog/2020/09/04/kubernetes-1-19-introducing-structured-logs/
Example unstructured logs
2025/02/05 21:39:37.653586 (17) Warning: app "myapp" with run id "BVWmSdjEPdh_AC6zhD3n5yBno8mUAAMBACdHIQEAAAARAgRDPPbVcBFejH5m3mYtlxJR0Lrjs_Fmz-7w7jvsChNBkXzDbDcDAAkxMS41LjAuMTgAF2RydXBhbC02ODk2NmQ4NTRiLXdoaDR3ABBw" received response code: 503: NR service unavailable
2025/02/05 21:56:17.852275 (17) Info: Reporting to: https://rpm.newrelic.com/accounts/redacted/applications/redacted
2025/02/05 21:56:17.852613 (17) Info: app 'myapp' connected with run id 'BWBkVJWUqAnyAC6zhD281wdno97oAAMBACdHIQEAAAARAgRDKYYecBFejH5m3mYtlxJR0Lrjs_Fmz-7w7jvsChNBkXzDbDcDAAkxMS41LjAuMTgAF2RydXBhbC02NTk3NGQ2Yzk2LWprY2o0A'