def initialize_framework_logging
for framework in ([ :active_record, :action_controller, :action_mailer ] & configuration.frameworks)
framework.to_s.camelize.constantize.const_get("Base").logger ||= Rails.logger
end
ActiveSupport::Dependencies.logger ||= Rails.logger
Rails.cache.logger ||= Rails.logger
end
ActiveRecord, ActionController, ActionMailer (のうちの必要なもの), ActiveSupport::Dependencies, Rails.cache (RAILS_CACHE) のロガーとして Rails.logger を設定しています。Rails.logger は次のメソッド。
def logger
if defined?(RAILS_DEFAULT_LOGGER)
RAILS_DEFAULT_LOGGER
else
nil
end
end
[Rails][CodeReading] Railsの初期化コードを読む (イントロ&目次)
0 件のコメント:
コメントを投稿