Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LukaszWiktor/61a236466ec6adde167f1962e926fc8d to your computer and use it in GitHub Desktop.
Save LukaszWiktor/61a236466ec6adde167f1962e926fc8d to your computer and use it in GitHub Desktop.
How to use a single Logentries account on Heroku

If you have multiple applications on Heroku and would like to use a single Logentries account for all of them, this is how you do it. Basically, do not use add-ons, and send all drains to your account.

  • In your Logentries account, click on Add Log
  • Select Manual
  • In the form that appears, input the following:
    • Log Name: access.log
    • Select Set: new set named myapp-{environment}, for instance myapp-staging (at least, this is how I like to name my entries)
    • Select the Plain TCP, UDP - logs are sent via syslog option
    • Click on Create Log Token

Logentries will set the log in discovery mode and assign you an URL and a port, such as data.logentries.com:12455.

Add a Heroku syslog drain and point it to this url:

$ heroku drains:add syslog://data.logentries.com:12455 --app myapp-staging

Your log entries will now be available in the newly configured log in Logentries (you may need to hit the Logentries refresh button to see the new events).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment