Commit e1b7e11b authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Use applogger in lib/gitlab/*

parent b720d175
---
title: Use applogger in lib/gitlab
merge_request: 41063
author: Rajendra Kadam
type: other
......@@ -10,7 +10,7 @@ module Gitlab
.includes(project: [:route, :group, namespace: [:owner]]).find_each do |statistics|
statistics.refresh!(only: [:wiki_size])
rescue => e
Rails.logger.error "Failed to update wiki statistics. id: #{statistics.id} message: #{e.message}" # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.error "Failed to update wiki statistics. id: #{statistics.id} message: #{e.message}"
end
end
end
......
......@@ -25,7 +25,7 @@ module Gitlab
certificate_valid_not_after: domain.x509&.not_after&.iso8601
)
rescue => e
Rails.logger.error "Failed to update pages domain certificate valid time. id: #{domain.id}, message: #{e.message}" # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.error "Failed to update pages domain certificate valid time. id: #{domain.id}, message: #{e.message}"
end
end
end
......
......@@ -18,7 +18,7 @@ module Gitlab
@limit = limit
@dry_run = dry_run
@niceness = (niceness || DEFAULT_NICENESS).downcase
@logger = logger || Rails.logger # rubocop:disable Gitlab/RailsLogger
@logger = logger || Gitlab::AppLogger
@total_found = @total_cleaned = 0
new_batch!
......
......@@ -22,7 +22,7 @@ module Gitlab
attr_reader :batch_size, :dry_run
attr_accessor :artifact_files
def initialize(batch_size:, dry_run: true, logger: Rails.logger) # rubocop:disable Gitlab/RailsLogger
def initialize(batch_size:, dry_run: true, logger: Gitlab::AppLogger)
@batch_size = batch_size
@dry_run = dry_run
@logger = logger
......
......@@ -12,7 +12,7 @@ module Gitlab
def initialize(project, dry_run: true, logger: nil, limit: nil)
@project = project
@dry_run = dry_run
@logger = logger || Rails.logger # rubocop:disable Gitlab/RailsLogger
@logger = logger || Gitlab::AppLogger
@limit = limit
end
......
......@@ -49,7 +49,7 @@ module Gitlab
cmd = %W[#{ionice} -c Idle] + cmd if ionice
log_msg = "find command: \"#{cmd.join(' ')}\""
Rails.logger.info log_msg # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.info log_msg
cmd
end
......
......@@ -8,7 +8,7 @@ module Gitlab
attr_reader :logger
def initialize(logger: nil)
@logger = logger || Rails.logger # rubocop:disable Gitlab/RailsLogger
@logger = logger || Gitlab::AppLogger
end
def run!(dry_run: true)
......
......@@ -7,7 +7,7 @@ module Gitlab
BATCH_SIZE = 100
def initialize(logger: nil)
@logger = logger || Rails.logger # rubocop:disable Gitlab/RailsLogger
@logger = logger || Gitlab::AppLogger
end
def run!(dry_run: false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment