Skip to content

Instantly share code, notes, and snippets.

@mhamzas
Forked from ostinelli/logentries_manual_setup.md
Created August 11, 2022 21:37
Show Gist options
  • Save mhamzas/7c561cf1313a06306472bdbe50d8fdfc to your computer and use it in GitHub Desktop.
Save mhamzas/7c561cf1313a06306472bdbe50d8fdfc 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).

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