• /
  • Log in
  • Free account

Logs in context of apps and hosts

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

To see how logs in context and log patterns can help you find the root cause of an issue, watch this short video (approx. 5 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.

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

Here is an example of logs for your app's UI. You can see logs in context of events for the selected time period, and drill down into detailed data for any of the highlighted attributes. To take advantage of even more capabilities, click Query logs from here to go directly to the Logs UI.

Logs in context in APM UI

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 logs in context for APM or infrastructuring monitoring, make the most of your logging data in the New Relic One UI:

Here is an example of logs in context for app trace details, visible from the APM UI.

Logs in context of trace details in APM UI

Create issueEdit page
Copyright © 2022 New Relic Inc.