Skip to content

Installing Logagent on Heroku

Run Logagent as Heroku Log Drain

You can forward your Heroku logs to Sematext using Heroku Log Drain like this:

heroku drain:add --app HerokuAppName URL

Here are the steps:

To ship your Heroku logs to Sematext or Elasticsearch deploy Logagent on Heroku. It will act as an HTTPS log drain.

  1. Get a free account
  2. Create a Logs App to obtain the App Token
  3. Deploy Logagent to Heroku using the Deploy to Heroku button

Deploy ... or use the following commands:

  git clone
  cd logagent-js
  heroku login
  heroku create
  git push heroku master

  1. Add the log drain using the URL format like Use the following command to grab the dynamically assigned name from "heroku create" command.

  heroku drains:add --app YOUR_HEROKU_MAIN_APPLICATION `heroku info -s | grep web-url | cut -d= -f2`$LOGSENE_TOKEN

When you see logs in Sematext you can define Alert Queries, build Dashboards, etc.

  1. Scale Logagent service on Heroku

To handle high log volume, scale Logagent on demand using

heroku scale web=3

See also: - How to Ship Heroku Logs to Sematext / Managed ELK Stack