From 3560b11922fd180eea5cafd0e763e0e601c5c4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 6 Dec 2018 20:49:31 +0100 Subject: Prefer to use correlation-id in logs This changes `correlation_id` to be `correlation-id` when passed via jobs --- spec/initializers/lograge_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/initializers') diff --git a/spec/initializers/lograge_spec.rb b/spec/initializers/lograge_spec.rb index af54a777373..bf5dde7fe66 100644 --- a/spec/initializers/lograge_spec.rb +++ b/spec/initializers/lograge_spec.rb @@ -11,7 +11,7 @@ describe 'lograge', type: :request do it 'logs to api_json log' do # we assert receiving parameters by grape logger expect_any_instance_of(Gitlab::GrapeLogging::Formatters::LogrageWithTimestamp).to receive(:call) - .with(anything, anything, anything, a_hash_including("correlation_id" => "new-correlation-id")) + .with(anything, anything, anything, a_hash_including("correlation-id" => "new-correlation-id")) .and_call_original subject @@ -24,12 +24,12 @@ describe 'lograge', type: :request do it 'logs to production_json log' do # formatter receives a hash with correlation id expect(Lograge.formatter).to receive(:call) - .with(a_hash_including("correlation_id" => "new-correlation-id")) + .with(a_hash_including("correlation-id" => "new-correlation-id")) .and_call_original # a log file receives a line with correlation id expect(Lograge.logger).to receive(:send) - .with(anything, include('"correlation_id":"new-correlation-id"')) + .with(anything, include('"correlation-id":"new-correlation-id"')) .and_call_original subject -- cgit v1.2.3