diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-25 19:52:19 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-25 19:52:19 -0300 |
commit | 026ce5ddf11c4cda0aae7f33a9266e54117db318 (patch) | |
tree | 77874553d9f16141353af742075e85e6dbca3b25 | |
parent | 6f0a69c5899ebdc892e2aa23e68e2604fa70fb73 (diff) | |
parent | 608683745fdd1286488417011db57f25d541226d (diff) | |
download | rails-026ce5ddf11c4cda0aae7f33a9266e54117db318.tar.gz rails-026ce5ddf11c4cda0aae7f33a9266e54117db318.tar.bz2 rails-026ce5ddf11c4cda0aae7f33a9266e54117db318.zip |
Merge pull request #15476 from JacobEvelyn/master
Use logger environment settings in Rails console.
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 3 | ||||
-rw-r--r-- | railties/CHANGELOG.md | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index f1bdbc845c..b6de90e89d 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -58,6 +58,9 @@ module ActiveRecord require "active_record/railties/console_sandbox" if app.sandbox? require "active_record/base" console = ActiveSupport::Logger.new(STDERR) + console.formatter = Rails.logger.formatter + console.level = Rails.logger.level + Rails.logger.extend ActiveSupport::Logger.broadcast console end diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index df9f8fe993..8306233dcd 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,10 @@ +* Set Rails console to use log formatter and log level as specified for the + given environment. + + Fixes #15470. + + *Jacob Evelyn* + * Add `config/initializers/active_record_belongs_to_required_by_default.rb` Newly generated Rails apps have a new initializer called |