Our log management capabilities help you to collect, process, explore, query, and alert on your log data. To get your logs into New Relic, you can:
- Use your existing log forwarding solution to collect your logs and extend the metadata that is forwarded to New Relic.
- Use our infrastructure agent as a lightweight data collector, without having to use additional software.
- Use our Log API to forward your logs via HTTP.
- Use syslog protocols to forward your logs via a TCP endpoint.
The following diagram shows the lifecycle of a log message for an app, from enrichment with APM agent metadata (contextual logging), to formatting and forwarding the log data to New Relic.
This diagram illustrates the flow of log messages through New Relic.
Standard log formatters transform log events into meaningful output (such as text files) that can be used by downstream people and processes. The
NewRelicFormatter transforms log events into the JSON format expected by New Relic. These files contain log information and extended metadata.
When you configure your log forwarder (our infrastructure monitoring agent, Fluentd, Logstash, etc.), you can also extend and enrich your log data. By configuring logs in context, the log enricher links the formatted log data with additional transaction information from your application or host.
Now your log files are enriched with enhanced metadata and contextual logging data. Your log forwarder sends the files to our logging endpoint for processing. From there you can use our log management capabilities to view, query, set up alerts, and more in New Relic.
Here is an example of logs for your host'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.
Here is an example of a host's logs in context related to an event.
To forward your logs to New Relic with enriched metadata:
- If you don't have one already, create a New Relic account. It's free, forever.
- Have your New Relic account's license key.
- Install a compatible log forwarder.
- Ensure that outbound connectivity on TCP port 443 is allowed to the CIDR range that matches your region.
- Use the DNS name
- For apps monitored by a New Relic APM agent, configure logs in context.
Use any of these solutions to forward your logs to New Relic.
You can use our guided install process to quickly and easily install log management and infrastructure monitoring together! To get learn how the guided install process works and how to use the logging data you see in New Relic One, watch this Nerdlog video on YouTube (14:46 minutes):
Other log forwarding plugins:
- Fluent Bit plugin
- Fluentd plugin
- Google Cloud Platform Pub/Sub
- Heroku log streaming
- Kubernetes plugin
- Logstash plugin
- Vector plugin
In some situations you may not have log forwarders; for example, with CDNs, hardware devices, or managed services. You can use syslog protocols such as
syslog-ng, and forward your logs to New Relic via a TCP endpoint.
If you prefer to connect to New Relic without installing a plugin, we offer an HTTP input integration. This option sends your monitored log data directly to New Relic via the Log API.
After you enable your log forwarder, make the most of your data in New Relic with our log management capabilities:
- 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 if you are forwarding your logs with our infrastructure monitoring agent. Review your infrastructure logs in the UI.
- Set up alerts.
- Query your data and create dashboards. For example, to query and manage your data partition rules, see our NerdGraph tutorial.