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

Adjusting Rails's logging level


Heroku's Logplex will record all of our application logs that are directed to Standard Output (STDOUT). By default, Rails applications write to a logfile instead of STDOUT. Heroku solves this by automatically injecting a gem into all Rails applications to ensure that the logs are correctly recorded. This gem also gives us the ability to change our logging level on the fly using a configuration variable. In this recipe, we will learn how to adjust a Ruby on Rails application's logging level without having to redeploy any code.

Getting ready

If we do not already have a Rails application, we can use a sample application from GitHub. Open up a terminal and run the following commands to get a Rails application up and running on Heroku:

$ git clone https://github.com/mscoutermarsh/unicorn-rails-heroku.git 
$ cd unicorn-rails-heroku 
$ heroku create 
$ git push heroku master 
$ heroku open

Note

To commit your changes back to GitHub, you'll need to make a fork of the...