Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Storing historical logs with PaperTrail


Heroku only keeps the most recent 1,500 lines of logs from our application. As we scale up and add more dynos, this will only cover a very brief time period. Heroku allows us to set up log drains, which allow us to stream our logs to another service for storage. Setting up log draining is a must-have for any production application. Having our log history easily searchable will be critical when debugging our application. In this recipe, we'll learn how to set up PaperTrail to store our Heroku logs.

How to do it…

To get started, let's fire up a terminal and navigate to one of our Heroku projects. Then, we can perform the following steps:

  1. First, let's add PaperTrail to our application using Heroku add-ons. The default plan is free; as our application grows, we can add more storage if necessary:

    $ heroku addons:add papertrail
    

    Note

    We can also install PaperTrail without going through the Heroku add-on, but then, we'd miss out on some of the enhancements that...