Skip to content

A platform for community discussion. Free, open, simple.

DEV: keep `bin/unicorn` clean from log noise

Samb504398a9125
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