Collect Heroku logs
This log integration is currently in public beta
Heroku provides 3 types of logs:
App Logs: output from the application you pushed on the platform.
System Logs: messages about actions taken by the Heroku platform infrastructure on behalf of your app.
API Logs: administrative questions implemented by you and other developers working on your app.
Heroku’s HTTP/S drains buffer log messages and submit batches of messages to an HTTPS endpoint via a POST request.
The POST body contains Syslog formatted messages, framed using the Syslog TCP protocol octet counting framing method.
The Datadog HTTP API implements and understands the Logplex standard defined by the content-header
To send all these logs to Datadog:
- Connect to your Heroku project.
- Set up the HTTPS drain with the following command:
heroku drains:add 'https://http-intake.logs./api/v2/logs/?dd-api-key=<DD_API_KEY>&ddsource=heroku&env=<ENV>&service=<SERVICE>&host=<HOST>' -a <APPLICATION_NAME>
<DD_API_KEY> with your Datadog API Key.
<ENV> with your application’s environment.
<SERVICE> with your application name.
<HOST> with the desired hostname. Note: Per the host section, metrics and traces set the default host name to the dyno name. It is not yet possible to dynamically set the dyno name as the hostname for logs. For now, to correlate between metrics, traces, and logs the
dynotype tags can be used.
Add custom attributes to logs from your application by replacing the URL in the drain as follows: