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 namedmyapp-{environment}
, for instancemyapp-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
- Log Name:
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).
So helpful. Thanks! 👍