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.
How it works
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.
Get started with log forwarders
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
log-api.newrelic.com
orlog-api.eu.newrelic.com
for configuration. - For apps monitored by a New Relic APM agent, configure logs in context.
Log forwarding options
Use any of these solutions to forward your logs to New Relic.
Recommended:
Amazon:
Microsoft:
Other log forwarding plugins:
- Fluent Bit plugin
- Fluentd plugin
- Google Cloud Platform Pub/Sub
- Heroku log streaming
- Kubernetes plugin
- Logstash plugin
- Vector plugin
TCP endpoint
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 rsyslog
and syslog-ng
, and forward your logs to New Relic via a TCP endpoint.
Log API
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.
What's next?
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.
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.