If you use New Relic Logs and New Relic APM, you can configure logs in context to correlate log data with other New Relic features. If you use a logging framework not covered by our existing logs in context solutions, we provide a way for you to configure your logging libraries to achieve annotated logs necessary for logs in context.
APM agent trace metadata and linking metadata APIs
To get properly annotated logs for logs in context, use APM agent API calls (listed below). These APIs pass metadata required for linking log data to other New Relic data. This metadata is referred to as trace metadata and linking metadata. For tips on using these, see Resources for correct annotation.
APM agent APIs:
- Go agent APIs:
- Java agent APIs:
- .NET agent APIs:
- Node.js agent APIs:
- PHP agent APIs:
- Python agent API:
- Ruby agent APIs:
Resources for correctly annotating logs
For more information on using the trace metadata and linking metadata APIs to annotate logs for logs in context, see the following resources:
- Review the APM agent specifications for getting properly formatted annotated logs for logs in context functionality, which include the required fields and properly formatted output.
- View the source code for our own logs in context extensions to see how we use these APIs: