• /
  • Log in
  • Free account

Configure logs in context with APM agents

When you need to correlate log data with other telemetry data, enable logs in context in New Relic. Logs in context adds metadata that links your logs with related APM data, like errors or distributed traces, or your platform performance data from infrastructure monitoring in New Relic One.

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.

The following diagram shows the lifecycle of a log message, from enrichment with agent metadata (contextual logging), to formatting and forwarding the log data to New Relic:

New Relic logs in context diagram

This diagram illustrates the flow of log messages through New Relic.

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.

Basic process to enable logs in context

The process to enable logs in context is basically the same, regardless of which APM agent you use to monitor your application:

  1. Make sure you have already set up logging in New Relic. This includes configuring a supported log forwarder that collects your application logs and extends the metadata that is forwarded to New Relic.
  2. Update to a supported APM agent version for your app, and enable distributed tracing.
  3. Configure logs in context for your APM agent or for your infrastructure monitoring agent.
  4. View your logs within the context of your apps or infrastructure in New Relic One.

The main differences in this procedure are which log appenders you can use to extend and enrich your log data, and how to configure the log appender you select for your APM agent.

For detailed information, see the logs-in-context procedures for:

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:

What's next?

After you set up APM logs in context, make the most of your logging data:

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.