aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-01-13 18:30:48 +0100
committerYves Senn <yves.senn@gmail.com>2014-01-13 19:00:45 +0100
commite0a521cfcd13e4d1f0ae8ab96004289e1c020f71 (patch)
tree3cfc6d031c0946bd1b669f5a17d60be8998955d6 /railties/lib
parent4f779e32d875209d917b01e4252ad34712178f26 (diff)
downloadrails-e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.tar.gz
rails-e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.tar.bz2
rails-e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.zip
Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.
This prevents Rails from assigning meaningless log levels to third party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)` we simply assign the `config.log_level` as is. This bug was introduced by #11665.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application/bootstrap.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb
index a26d41c0cf..33bcab1e57 100644
--- a/railties/lib/rails/application/bootstrap.rb
+++ b/railties/lib/rails/application/bootstrap.rb
@@ -53,7 +53,11 @@ INFO
logger
end
- Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
+ if ::Logger === Rails.logger
+ Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
+ else
+ Rails.logger.level = config.log_level
+ end
end
# Initialize cache early in the stack so railties can make use of it.