diff --git a/Gemfile b/Gemfile index 8543d6be9..9c183e32c 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,6 @@ gem 'puma', '~> 8.0' gem 'rack_content_type_default', '~> 1.1' gem 'rack-cors' gem 'rails', '~> 8.1.3' -gem 'rails_semantic_logger', '~> 4.20' gem 'ruby-progressbar', '~> 1.13', require: false gem 'ruby-vips' gem 'sentry-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 83595d64a..a88961748 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -403,10 +403,6 @@ GEM rails-html-sanitizer (1.7.0) loofah (~> 2.25) 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) - rails_semantic_logger (4.20.0) - rack - railties (>= 5.1) - semantic_logger (~> 4.16) railties (8.1.3) actionpack (= 8.1.3) activesupport (= 8.1.3) @@ -517,8 +513,6 @@ GEM childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2) - semantic_logger (4.18.0) - concurrent-ruby (~> 1.0) sentry-rails (6.6.0) railties (>= 5.2.0) sentry-ruby (~> 6.6.0) @@ -624,7 +618,6 @@ DEPENDENCIES rack_content_type_default (~> 1.1) rails (~> 8.1.3) rails-erd - rails_semantic_logger (~> 4.20) rspec rspec-rails rspec_junit_formatter diff --git a/config/application.rb b/config/application.rb index 0475c0df9..53566619a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -73,8 +73,5 @@ class Application < Rails::Application config.x.cloudflare_turnstile.secret_key = ENV.fetch('CLOUDFLARE_TURNSTILE_SECRET_KEY', nil) config.x.cloudflare_turnstile.enabled = ENV['CLOUDFLARE_TURNSTILE_SECRET_KEY'].present? - - config.rails_semantic_logger.format = :json - config.semantic_logger.application = 'editor-api' end end diff --git a/config/environments/production.rb b/config/environments/production.rb index d1e1d4c7a..eddc64960 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -45,13 +45,10 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Log to STDOUT on Heroku in JSON format, where this variable is set automatically. - if ENV['RAILS_LOG_TO_STDOUT'].present? - $stdout.sync = true - config.rails_semantic_logger.add_file_appender = false - config.semantic_logger.add_appender(io: $stdout, formatter: :json) - config.semantic_logger.application = "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}" - end + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new($stdout) + .tap { |logger| logger.formatter = Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } # Prepend all log lines with the following tags. config.log_tags = [:request_id] diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index d6ca00c5c..37979057d 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -18,7 +18,7 @@ # config.flipper.strict = Rails.env.development? && :warn ## Show Flipper checks in logs - config.flipper.log = false + # config.flipper.log = true ## Reconfigure Flipper to use the Memory adapter and disable Cloud in tests # config.flipper.test_help = true