Commit 53825fd9 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Use applogger in config/*

parent 65e7b302
---
title: Use applogger in config/initializers/*
merge_request: 41047
author: Rajendra Kadam
type: other
...@@ -16,7 +16,7 @@ def prometheus_default_multiproc_dir ...@@ -16,7 +16,7 @@ def prometheus_default_multiproc_dir
end end
Prometheus::Client.configure do |config| Prometheus::Client.configure do |config|
config.logger = Rails.logger # rubocop:disable Gitlab/RailsLogger config.logger = Gitlab::AppLogger
config.initial_mmap_file_size = 4 * 1024 config.initial_mmap_file_size = 4 * 1024
......
...@@ -7,7 +7,7 @@ if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq? ...@@ -7,7 +7,7 @@ if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq?
ActiveSupport.on_load(:active_record) do ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.establish_connection ActiveRecord::Base.establish_connection
Rails.logger.debug("ActiveRecord connection established") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.debug("ActiveRecord connection established")
end end
end end
end end
...@@ -20,6 +20,6 @@ if defined?(ActiveRecord::Base) ...@@ -20,6 +20,6 @@ if defined?(ActiveRecord::Base)
# as there's no need for the master process to hold a connection # as there's no need for the master process to hold a connection
ActiveRecord::Base.connection.disconnect! ActiveRecord::Base.connection.disconnect!
Rails.logger.debug("ActiveRecord connection disconnected") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.debug("ActiveRecord connection disconnected")
end end
end end
...@@ -2,7 +2,7 @@ if Rails.env.development? || ENV['GITLAB_LEGACY_PATH_LOG_MESSAGE'] ...@@ -2,7 +2,7 @@ if Rails.env.development? || ENV['GITLAB_LEGACY_PATH_LOG_MESSAGE']
deprecator = ActiveSupport::Deprecation.new('11.0', 'GitLab') deprecator = ActiveSupport::Deprecation.new('11.0', 'GitLab')
deprecator.behavior = -> (message, callstack) { deprecator.behavior = -> (message, callstack) {
Rails.logger.warn("#{message}: #{callstack[1..20].join}") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.warn("#{message}: #{callstack[1..20].join}")
} }
ActiveSupport::Deprecation.deprecate_methods(Gitlab::GitalyClient::StorageSettings, :legacy_disk_path, deprecator: deprecator) ActiveSupport::Deprecation.deprecate_methods(Gitlab::GitalyClient::StorageSettings, :legacy_disk_path, deprecator: deprecator)
......
...@@ -28,7 +28,7 @@ module Sidekiq ...@@ -28,7 +28,7 @@ module Sidekiq
Use an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead. Use an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead.
MSG MSG
rescue Sidekiq::Worker::EnqueueFromTransactionError => e rescue Sidekiq::Worker::EnqueueFromTransactionError => e
::Rails.logger.error(e.message) if ::Rails.env.production? Gitlab::AppLogger.error(e.message) if ::Rails.env.production?
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e) Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e)
end end
end end
......
...@@ -70,7 +70,7 @@ Sidekiq.configure_server do |config| ...@@ -70,7 +70,7 @@ Sidekiq.configure_server do |config|
cron_jobs[k]['class'] = cron_jobs[k].delete('job_class') cron_jobs[k]['class'] = cron_jobs[k].delete('job_class')
else else
cron_jobs.delete(k) cron_jobs.delete(k)
Rails.logger.error("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.error("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.")
end end
end end
Sidekiq::Cron::Job.load_from_hash! cron_jobs Sidekiq::Cron::Job.load_from_hash! cron_jobs
......
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