If your log data is already being monitored by Heroku's built-in Logplex router, you can use our integration to forward and enrich your log data in New Relic. This integration uses Heroku Syslog drains.
Forwarding your Heroku logs to New Relic will give you enhanced log management capabilities to collect, process, explore, query, and alert on your log data.
Create a Heroku Syslog drain
To enable our log management capabilities, start by creating a Heroku Syslog drain.
Make sure your New Relic user account has the Admin role assigned to it.
Download and install the Heroku CLI.
Use the Heroku CLI to create a Syslog drain and attach it to the application you want to stream logs from, replacing
YOUR_APP_NAME
with the name of your Heroku application.$ heroku drains:add syslog+tls://newrelic.syslog.nr-data.net:6515 -a YOUR_APP_NAME
Run the following command and copy the Heroku Syslog drain token from the
token
attribute:$ heroku drains -a YOUR_APP_NAME --json
{"addon": null,"created_at": "2018-12-04T00:59:46Z","id": "906262a4-e151-45d2-b35a-a2dc0ea9e688","token": "d.f14da5dc-106b-468d-b1bd-bed0ed9fa1e7","updated_at": "2018-12-04T00:59:47Z","url": "syslog+tls://newrelic.syslog.nr-data.net:6515}
Register a Heroku Syslog drain
Next, you'll need to register your newly created Heroku Syslog drain in New Relic:
Log in to New Relic Logs and click Add more data sources.
Click the Heroku tile under Log ingestion.
Choose the New Relic account to stream your Heroku application logs to, and click Continue.
Paste your newly created Heroku drain token in the Heroku drain token field.
Click Add Heroku drain log to complete registration.
Important
Heroku currently doesn't support customizing the format of logs sent from Logplex. For more information, see Heroku's log format documentation.
View log data
If everything is configured correctly and your data is being collected, you should see data logs in both of these places:
- New Relic Logs UI
- New Relic tools for running NRQL queries. For example, you can execute a query like this:
SELECT * FROM Log
If no data appears after you enable our log management capabilities, follow our standard log troubleshooting procedures.
What's next?
Explore logging data across your platform with the New Relic One UI.
- Get deeper visibility into both your application and your platform performance data by forwarding your logs with our logs in context capabilities.
- Set up alerts.
- Query your data and create dashboards.
Disable log forwarding
To disable log forwarding capabilities, follow standard procedures in Heroku Syslog documentation. You do not need to do anything else in New Relic.