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 ...

Get The Rails™ 4 Way, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.