lib/semantic_logger/logger.rb in semantic_logger-2.2.0 vs lib/semantic_logger/logger.rb in semantic_logger-2.3.0
- old
+ new
@@ -3,11 +3,19 @@
# Logger stores the class name to be used for all log messages so that every
# log message written by this instance will include the class name
module SemanticLogger
class Logger < Base
- # Add unused formatter to support Rails 4 logging
+ # DO NOT USE. Adding unused formatter to support Rails 4 logging
# Formatters must be set at the appender level, not at the logger level
+ #
+ # Due to the following code in Rails::Server#start that cannot be changed
+ # without patching the entire method
+ # console = ActiveSupport::Logger.new($stdout)
+ # console.formatter = Rails.logger.formatter
+ # console.level = Rails.logger.level
+ #
+ # Rails.logger.extend(ActiveSupport::Logger.broadcast(console))
attr_accessor :formatter
# Returns a Logger instance
#
# Return the logger for a specific class, supports class specific log levels