Skip to content

Instantly share code, notes, and snippets.

@ostinelli
Last active August 11, 2022 21:37
Show Gist options
  • Save ostinelli/d4fd2fb29ef29a58d404 to your computer and use it in GitHub Desktop.
Save ostinelli/d4fd2fb29ef29a58d404 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 the provided 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).

@timkinnane
Copy link

So helpful. Thanks! 👍

@mikebaldry
Copy link

Thank you. I've managed to do this before myself but its not very intuitive and couldn't remember the exact steps.

Copy link

ghost commented Mar 23, 2017

Thank you! 💯

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