O'Reilly logo

The Rails™ 4 Way, Third Edition by Kevin Faustino, Obie Fernandez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B.31 ActiveSupport::Logger

Accessible via the logger property in various Rails contexts such as Active Record models and controller classes. Always accessible via Rails.logger. Use of the logger is explained in Chapter 1, “Rails Environments and Configuration.”

B.31.1 active_support/logger

Logger.broadcast(logger)

Generates an anonymous module that is used to extend an existing logger, which adds the behavior to broadcast to multiple loggers. For instance, when initializing a Rails console, Rails.logger is extended to broadcast to STDERR, causing Rails to log to both a log file and STDERR.

1 console = ActiveSupport::Logger.new(STDERR)2 Rails.logger.extend ActiveSupport::Logger.broadcast(console)

B.31.2 active_support/logger_silence ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required