Log Drains make it easy to collect logs from your deployments and forward them to archival, search, and alerting services by sending them via HTTPS, HTTP, TLS, and TCP.

Heroku Log Drains

With Heroku log drains you can forward logs from your apps, and deployments to Axiom by sending them via HTTPS.

Prerequisites

Installation

Sign up and login to your account on Heroku, and download the Heroku CLI

Configuration

Heroku log drains configuration consists of three main components

heroku drains:add https://API_TOKEN@api.axiom.co/v1/datasets/DATASET_NAME/ingest -a HEROKU_APPLICATION_NAME
  • Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.
  • Replace DATASET_NAME with the name of the Axiom dataset where you want to send data.
  • Replace HEROKU_APPLICATION_NAME with the name of the app that you created on the Heroku dashboard or the Heroku CLI.

See creating an Heroku app for more

Back in your dataset you see your Heroku logs.

Logging codes