Commit 69882367 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'app-logger-9' into 'master'

Use applogger in some files of ee/lib/* and spec files

See merge request gitlab-org/gitlab!41056
parents d6c9e1a5 da930a50
---
title: Use applogger in some files of ee/lib/* and spec files
merge_request: 41056
author: Rajendra Kadam
type: other
......@@ -532,7 +532,7 @@ module API
::Gitlab::Tracking.event(category, action.to_s, **args)
rescue => error
Rails.logger.warn( # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.warn(
"Tracking event failed for action: #{action}, category: #{category}, message: #{error.message}"
)
end
......
......@@ -67,7 +67,7 @@ module API
result == 'PONG'
rescue => e
Rails.logger.warn("GitLab: An unexpected error occurred in pinging to Redis: #{e}") # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.warn("GitLab: An unexpected error occurred in pinging to Redis: #{e}")
false
end
......
......@@ -183,7 +183,7 @@ RSpec.describe API::Helpers do
end
it "logs an exception" do
expect(Rails.logger).to receive(:warn).with(/Tracking event failed/)
expect(Gitlab::AppLogger).to receive(:warn).with(/Tracking event failed/)
subject.track_event('my_event', category: nil)
end
......
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