Use the New Relic Logs UI to:
- Quickly spot interesting patterns in your logs; for example, discovering that a majority of the errors occurred on a single host.
- Explore and manipulate your logging data by using attributes as search conditions.
- Control what attributes appear in the line chart, and add or remove columns in the logs table, so that you can understand the structure of your data at a glance.
- Examine more context around a particular log line; for example, see what was happening on a particular host leading up to the error.
- Share the data with charts, add to dashboards, etc.
- Set up alert conditions for problems you want to prevent.
To help you get the most out of the Logs user interface, follow this basic workflow.
- Sign in to New Relic: Go to one.newrelic.com > Logs.
Search with keywords or phrases to find the results you want; for example,
From the search field, use the type-ahead dropdowns to select an attribute, operator, and value; for example:
service_name equals my service
For more information, see the Logs query syntax documentation.
Look for patterns:
To spot suspicious spikes or drops in log messages, skim the Volume chart. Then, to zoom in to a specific area, click and drag. Or, to jump directly to logs for a specific point in time, click that point on the chart.
Narrow your focus:
To narrow the focus of your initial search results or quickly find outliers, expand any of the attributes to view the ten most common values within the results. For example, if a host listed under the
hostnameattribute is generating significantly more error messages than the others, select that value to apply it to your search.
Examine log details:
To see which attributes are included in a log message, select the log line. (Add or remove columns as needed to help you focus on the details you need.) Then, to control which attributes appear in the results, select a value or highlight text to include or exclude it from your search.
Get related logs:
To view all the logs for a specific value: From the selected log's Log details attributes list, select
Show surrounding logs.
You can also use any of the core New Relic One UI functions (specific account, time range, chart builder, etc.).
Here are a few examples of how you can use the Logs UI to get detailed information. To use some of these examples, you must be able to see logs in context.
- Create an alert from log data
You can create alert conditions directly in the Logs UI:
- Go to one.newrelic.com > Logs.
- Search for results that you want to alert on; for example,
service_name:"your service" "fatal error".
- In the search bar, click the plus icon, then select Create an alert from this.
- Complete the Create alert condition that slides out, then review the NRQL query that will power the alert condition.
After you save the Logs alert condition, you can view it in the Alerts UI, where you can make additional changes as needed.
- Add log volume chart to a dashboard
You can add log charts to a dashboard directly from the Logs UI.
- Go to one.newrelic.com > Logs.
- Search for results you want to plot; for example,
service_name:"checkout service" "process failed".
- From the attribute list, select an attribute to facet the chart; for example,
- At the top right of the chart, select the chart options ... button, click Add to dashboard, and complete the form.
You can also create charts with Insights or the chart builder in New Relic One.
- Troubleshoot an error (logs in context)
To troubleshoot errors this way, you must be able to see logs in context. Then, to have a better understanding of what was happening on the host at the time an error occurred in your app:
- Go to rpm.newrelic.com > APM > (select an app) > Events > Error analytics > (select an error trace).
- From the error trace Details, click See logs.
- From the Logs UI, browse the related log details.
- To identify the host generating the error and to continue your investigation, click Show surrounding logs.
- Troubleshoot latency (logs in context)
To troubleshoot latency this way, you must be able to see logs in context. Then, to have a better understanding of how your systems were operating when performance noticeably slowed:
Links to logs in New Relic
Depending on your New Relic subscription, you can access your logs from several places in the New Relic UI. For some of these options, you must be able to see logs in context.
|To view logs...||Do this...|
|Directly from the Logs UI||Go to one.newrelic.com > Logs.|
|From an entity||Go to one.newrelic.com > Entity explorer > (select an entity) > Logs (if available).|
|From distributed tracing||Go to one.newrelic.com > Distributed tracing > (select a trace > Logs (if available).|
|From Kubernetes||Go to one.newrelic.com > Kubernetes cluster explorer > (select a cluster) > (select a pod or container) > See logs (if available).|
|From your app in New Relic APM (logs in context)||Go to rpm.newrelic.com > APM > (select an app) > Events > Logs (if available).|
|From an error trace in New Relic APM (logs in context)||Go to rpm.newrelic.com > APM > (select an app) > Error analytics > (select an error trace) > See logs (if available).|