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

Use appLogger in build and ssh host key

parent 0a066d83
......@@ -352,7 +352,7 @@ module Ci
begin
Ci::Build.retry(build, build.user)
rescue Gitlab::Access::AccessDeniedError => ex
Rails.logger.error "Unable to auto-retry job #{build.id}: #{ex}" # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.error "Unable to auto-retry job #{build.id}: #{ex}"
end
end
end
......
......@@ -107,7 +107,7 @@ class SshHostKey
if status.success? && !errors.present?
{ known_hosts: known_hosts }
else
Rails.logger.debug("Failed to detect SSH host keys for #{id}: #{errors}") # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.debug("Failed to detect SSH host keys for #{id}: #{errors}")
{ error: 'Failed to detect SSH host keys' }
end
......
---
title: Use applogger in build and ssh host key
merge_request: 32187
author: Rajendra Kadam
type: fixed
......@@ -3612,7 +3612,7 @@ describe Ci::Build do
.to receive(:execute)
.with(subject)
.and_raise(Gitlab::Access::AccessDeniedError)
allow(Rails.logger).to receive(:error)
allow(Gitlab::AppLogger).to receive(:error)
end
it 'handles raised exception' do
......@@ -3622,7 +3622,7 @@ describe Ci::Build do
it 'logs the error' do
subject.drop!
expect(Rails.logger)
expect(Gitlab::AppLogger)
.to have_received(:error)
.with(a_string_matching("Unable to auto-retry job #{subject.id}"))
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