The amount of log information that Heroku keeps for our application is limited to 1,500 lines. For a production application, this will only cover a very small span of time. We need to set up a log-draining service to keep a historical record of our logs and make it easy to search and view them. Here, we will learn how to set up Logentries on Heroku.
We can quickly get going with Logentries by installing it as an add-on through the CLI. Let's open up a terminal and navigate to our Heroku application to get started; then, we can perform the following steps:
First, let's install the Logentries add-on for our application:
$ heroku addons:add logentries
This command will set up a log drain that will automatically stream our logs to Logentries. Let's open it up and take a look:
$ heroku addons:open logentries
Logentries will automatically send us alerts when there are errors in our application. We can configure these by clicking on Tags &...