Skip to content

Commit 47f1b61

Browse files
authored
Revert "Use JSON-format structured logging in production (#882)" (#885)
This reverts commit e2a1252.
1 parent 3bc448b commit 47f1b61

5 files changed

Lines changed: 5 additions & 19 deletions

File tree

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ gem 'puma', '~> 8.0'
4343
gem 'rack_content_type_default', '~> 1.1'
4444
gem 'rack-cors'
4545
gem 'rails', '~> 8.1.3'
46-
gem 'rails_semantic_logger', '~> 4.20'
4746
gem 'ruby-progressbar', '~> 1.13', require: false
4847
gem 'ruby-vips'
4948
gem 'sentry-rails'

Gemfile.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,6 @@ GEM
403403
rails-html-sanitizer (1.7.0)
404404
loofah (~> 2.25)
405405
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
406-
rails_semantic_logger (4.20.0)
407-
rack
408-
railties (>= 5.1)
409-
semantic_logger (~> 4.16)
410406
railties (8.1.3)
411407
actionpack (= 8.1.3)
412408
activesupport (= 8.1.3)
@@ -517,8 +513,6 @@ GEM
517513
childprocess (>= 0.5, < 5.0)
518514
rexml (~> 3.2, >= 3.2.5)
519515
rubyzip (>= 1.2.2)
520-
semantic_logger (4.18.0)
521-
concurrent-ruby (~> 1.0)
522516
sentry-rails (6.6.0)
523517
railties (>= 5.2.0)
524518
sentry-ruby (~> 6.6.0)
@@ -624,7 +618,6 @@ DEPENDENCIES
624618
rack_content_type_default (~> 1.1)
625619
rails (~> 8.1.3)
626620
rails-erd
627-
rails_semantic_logger (~> 4.20)
628621
rspec
629622
rspec-rails
630623
rspec_junit_formatter

config/application.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,5 @@ class Application < Rails::Application
7373

7474
config.x.cloudflare_turnstile.secret_key = ENV.fetch('CLOUDFLARE_TURNSTILE_SECRET_KEY', nil)
7575
config.x.cloudflare_turnstile.enabled = ENV['CLOUDFLARE_TURNSTILE_SECRET_KEY'].present?
76-
77-
config.rails_semantic_logger.format = :json
78-
config.semantic_logger.application = 'editor-api'
7976
end
8077
end

config/environments/production.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@
4545
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4646
# config.force_ssl = true
4747

48-
# Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
49-
if ENV['RAILS_LOG_TO_STDOUT'].present?
50-
$stdout.sync = true
51-
config.rails_semantic_logger.add_file_appender = false
52-
config.semantic_logger.add_appender(io: $stdout, formatter: :json)
53-
config.semantic_logger.application = "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}"
54-
end
48+
# Log to STDOUT by default
49+
config.logger = ActiveSupport::Logger.new($stdout)
50+
.tap { |logger| logger.formatter = Logger::Formatter.new }
51+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
5552

5653
# Prepend all log lines with the following tags.
5754
config.log_tags = [:request_id]

config/initializers/flipper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# config.flipper.strict = Rails.env.development? && :warn
1919

2020
## Show Flipper checks in logs
21-
config.flipper.log = false
21+
# config.flipper.log = true
2222

2323
## Reconfigure Flipper to use the Memory adapter and disable Cloud in tests
2424
# config.flipper.test_help = true

0 commit comments

Comments
 (0)