From 1ffcbd9a4d84e2633839bf7ab0d5460ca1ebbd12 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 10 May 2021 14:18:43 +0000 Subject: [PATCH] Maintenance: Reduce log output by switching log level of serveral places. --- app/models/active_job_lock.rb | 2 +- app/models/channel/driver/imap.rb | 1 - lib/notification_factory/mailer.rb | 2 +- lib/search_index_backend.rb | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/models/active_job_lock.rb b/app/models/active_job_lock.rb index 2a8f89a8a..118fc8fa8 100644 --- a/app/models/active_job_lock.rb +++ b/app/models/active_job_lock.rb @@ -9,7 +9,7 @@ class ActiveJobLock < ActiveRecord::Base end def transfer_to(active_job) - logger.info "Transferring ActiveJobLock with id '#{id}' from active_job_id '#{active_job_id}' to active_job_id '#{active_job_id}'." + logger.debug { "Transferring ActiveJobLock with id '#{id}' from active_job_id '#{active_job_id}' to active_job_id '#{active_job_id}'." } reset_time_stamp = Time.zone.now update!( diff --git a/app/models/channel/driver/imap.rb b/app/models/channel/driver/imap.rb index bdeb92024..90b95b4ff 100644 --- a/app/models/channel/driver/imap.rb +++ b/app/models/channel/driver/imap.rb @@ -354,7 +354,6 @@ example raise too_large_messages.join("\n") end - Rails.logger.info 'done' { result: result, fetched: count_fetched, diff --git a/lib/notification_factory/mailer.rb b/lib/notification_factory/mailer.rb index 541dd8f37..d927c2a43 100644 --- a/lib/notification_factory/mailer.rb +++ b/lib/notification_factory/mailer.rb @@ -147,7 +147,7 @@ returns raise Exceptions::UnprocessableEntity, "Unable to send mail to user with id #{data[:recipient][:id]} because there is no email available." if data[:recipient][:email].blank? sender = Setting.get('notification_sender') - Rails.logger.info "Send notification to: #{data[:recipient][:email]} (from:#{sender}/subject:#{data[:subject]})" + Rails.logger.debug { "Send notification to: #{data[:recipient][:email]} (from:#{sender}/subject:#{data[:subject]})" } content_type = 'text/plain' if data[:content_type] diff --git a/lib/search_index_backend.rb b/lib/search_index_backend.rb index 466ff975d..f13b2fb3f 100644 --- a/lib/search_index_backend.rb +++ b/lib/search_index_backend.rb @@ -319,7 +319,7 @@ remove whole data from index return [] if !data data.map do |item| - Rails.logger.info "... #{item['_type']} #{item['_id']}" + Rails.logger.debug { "... #{item['_type']} #{item['_id']}" } output = { id: item['_id'], @@ -915,7 +915,7 @@ helper method for making HTTP calls =end def self.make_request(url, data: {}, method: :get, open_timeout: 8, read_timeout: 180) - Rails.logger.info "# curl -X #{method} \"#{url}\" " + Rails.logger.debug { "# curl -X #{method} \"#{url}\" " } Rails.logger.debug { "-d '#{data.to_json}'" } if data.present? options = { @@ -930,7 +930,7 @@ helper method for making HTTP calls response = UserAgent.send(method, url, data, options) - Rails.logger.info "# #{response.code}" + Rails.logger.debug { "# #{response.code}" } response end