From b504398a912595890c30b4b8f5f09b50ad95073a Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 14 Aug 2018 08:49:57 +1000 Subject: [PATCH] DEV: keep `bin/unicorn` clean from log noise --- bin/rails | 1 + config/initializers/100-logster.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/rails b/bin/rails index d7b24fe7edd..04b8e02fe18 100755 --- a/bin/rails +++ b/bin/rails @@ -2,6 +2,7 @@ if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server") ENV["UNICORN_PORT"] = "3000" + ENV["RAILS_LOGS_STDOUT"] ||= "1" exec File.expand_path("unicorn", __dir__) end diff --git a/config/initializers/100-logster.rb b/config/initializers/100-logster.rb index f5d5aa51220..beb25ed955c 100644 --- a/config/initializers/100-logster.rb +++ b/config/initializers/100-logster.rb @@ -1,4 +1,4 @@ -if Rails.env.development? && !Sidekiq.server? +if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1" console = ActiveSupport::Logger.new(STDOUT) original_logger = Rails.logger.chained.first console.formatter = original_logger.formatter