To enable STDOUT logging in Rails 4 you can add the rails_12factor gem.
Heroku treats logs as streams and requires your logs to be sent to STDOUT. To do this you will need to configure your Rails 4 app to connect to Postgres, your logs need to be configured to point to STDOUT, and your application needs to have serving assets enabled in production. Most of Rails works out of the box with Heroku, however there are a few things you can do to get the most out of the platform. This article assumes that you have a copy of the Heroku CLI installed locally. If you are new to either please see the Getting Started with Rails 4.x on Heroku instead. It assumes a knowledge of both Heroku and with Rails.
This article covers how to run a Ruby on Rails application on Heroku. If you are starting a new application, we recommend you use the most recently released version of Rails. This version of Rails is no longer supported by Ruby core. We cannot guarantee that any statements made are still true or that the instructions will still work. It is presented here for historical reference only.