If you use log management and 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:
- Go: Logrus extension
- Java: Log4j2 extension
- .NET: Serilog extension
- Node.js: Winston extension
- Python: see Python agent logging configuration
- PHP: Monolog extension
- Ruby: Logging extension
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.