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

This commit is contained in:
Sam 2018-08-14 08:49:57 +10:00
parent 983dba37ce
commit b504398a91
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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