From 78969d77199f51395c07a04c35a18bdb5ac8b87c Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Fri, 6 Dec 2019 10:57:10 -0500 Subject: [PATCH] DEV: Support custom log level in dev See https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels Can be used to reduce noise when running "bundle exec rails server" in dev. Setting DISCOURSE_DEV_LOG_LEVEL="warn" will make for easier puts debugging with unicorn. --- config/environments/development.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 473347772f7..55a8f8e6c93 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true Discourse::Application.configure do - # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on @@ -38,6 +37,8 @@ Discourse::Application.configure do config.action_mailer.raise_delivery_errors = true + config.log_level = ENV['DISCOURSE_DEV_LOG_LEVEL'] if ENV['DISCOURSE_DEV_LOG_LEVEL'] + BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP'] if defined?(Unicorn) && ENV["UNICORN_WORKERS"].to_i != 1