Skip to content

Commit 6c7a0e8

Browse files
committed
Change railties default log_level to :error
The default of :info generates a ton of unnecessary noise in the railties logs.
1 parent 1d8d8e1 commit 6c7a0e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

railties/test/application/configuration_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def suppress_default_config
8989
def restore_default_config
9090
FileUtils.rm_rf("#{app_path}/config/environments")
9191
FileUtils.mv("#{app_path}/config/__environments__", "#{app_path}/config/environments")
92+
remove_from_env_config "production", "config.log_level = :error"
9293
end
9394

9495
test "Rails.env does not set the RAILS_ENV environment variable which would leak out into rake tasks" do

railties/test/isolation/abstract_unit.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def build_app(options = {})
145145
add_to_env_config :development, "config.action_view.annotate_rendered_view_with_filenames = false"
146146

147147
remove_from_env_config("development", "config.generators.apply_rubocop_autocorrect_after_generate!")
148+
add_to_env_config :production, "config.log_level = :error"
148149
end
149150

150151
def teardown_app
@@ -262,7 +263,7 @@ def self.name; "RailtiesTestApp"; end
262263
@app.config.eager_load = false
263264
@app.config.session_store :cookie_store, key: "_myapp_session"
264265
@app.config.active_support.deprecation = :log
265-
@app.config.log_level = :info
266+
@app.config.log_level = :error
266267
@app.config.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
267268

268269
yield @app if block_given?

0 commit comments

Comments
 (0)