aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/railtie.rb3
-rw-r--r--railties/CHANGELOG.md7
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