heroku/rails_log_stdout — pull request #2 by mattjbray (2012-11-07 18:33:14+00:00)
Title: Call set_logger in an initializer that is called before :initialize_logger

Ensures ActiveRecord, ActionController and ActionMailer loggers bind to
the new logger.

This is an alternative solution to #1. Here, `Rails.logger` is never set to anything other than the logger returned by `heroku_stdout_logger`.
```ruby
...
rails_log_stdout.initialize_logger # Proposed initializer
initialize_logger # Sets Rails.logger ||= config.logger || ...
...
bootstrap_hook # Runs before_initialize hooks - solution proposed in #1
...
action_controller.logger # Sets ActionController::Base.logger ||= Rails.logger
...
active_record.logger # Sets ActiveRecord::Base.logger ||= Rails.logger
...
action_mailer.logger # Sets ActionMailer::Base.logger ||= Rails.logger
...
finisher_hook # Runs after_intialize hooks - where Rails3.set_logger is currently called
...
```