Enabling New Relic's logs in context correlates your log data with data collected from our APM and infrastructure agents. This means that you'll see logs data or links to log data in other UI experiences, such as APM, infrastructure monitoring, distributed tracing, and errors inbox. You can use that log data to dig deeper into the performance of your app or host, without needing to manually search through log data.
To see how logs in context can help you find the root cause of an issue in your apps and hosts, watch this short video (approx. 3:40 minutes):
See the root cause of issues across your platform
By bringing all of your application and infrastructure data together in a single solution, you can get to the root cause of issues faster. Logs in context help you quickly see meaningful patterns and trends.
Don't spend extra time trying to narrow down all your logs from different parts of your platform. Instead, enable logs in context to see the exact log lines you need to identify and resolve a problem.
Automatic process
Our latest APM agents support automatically adding context and forwarding logs without the need to install or maintain third-party software! Your logs will automatically include attributes such as span.id
, trace.id
, hostname
, entity.guid
, entity.name
, and more. This metadata links your logs to traces, spans, infrastructure data, and other telemetry, making it easier to troubleshoot. For more information, see our APM logs in context documentation.
Drill down into your logs, traces, and errors, all from the APM Summary page in New Relic.
Not every language or logging framework is supported yet. The following are our currently supported environments, with links to language-specific documentation:
- Go logs in context procedures for agent v3.17.0 or higher
- Java logs in context procedures for agent v7.6.0 or higher
- .NET logs in context procedures for agent v9.7.0.0 or higher
- Node.js logs in context procedures for agent v8.11.0 or higher
- Python logs in context procedures for agent v7.12.0.176
- Ruby logs in context procedures for agent v8.6.0 or higher
If your APM agent doesn't support the automatic logs in context solution yet, you can continue to use our manual logs in context solutions, and forward your logs via our infrastructure agent or supported third-party forwarder.
Manual process to enable logs in context
To use our manual solution to set up logs in context for APM and for infrastructure monitoring, follow these steps.
Make sure log forwarding is enabled in New Relic. For our manual installation process, this includes configuring a supported log forwarder that collects your application logs and extends the metadata that is forwarded to New Relic. Recommendation: Use our infrastructure monitoring agent to easily get both your app's logging data and your host's logging data into New Relic.
Update to the supported APM agent version for your app, and enable distributed tracing. For specific instructions, select your agent:
- See your logs data in context with your apps and hosts in the New Relic UI.
API and other options
If our logging solutions don't meet your needs, you can use other options to send your log data to New Relic:
- Logging extensions via agent API calls
- HTTP endpoint via our Log API
- Syslog protocols via TCP endpoint (useful for CDNs, hardware devices, or managed services)
What's next?
After you set up logs in context for APM or infrastructuring monitoring, make the most of your logging data in the New Relic UI:
- Explore the logging data across your platform with our Logs UI.
- See your logs in context of your app's performance in the APM UI. Troubleshoot errors with distributed tracing, stack traces, application logs, and more.
- Get deeper visibility into both your application and your platform performance data by forwarding your logs with our infrastructure monitoring agent. Review your infrastructure logs in the UI.
- Set up alerts.
- Query your data and create dashboards.