Commit 4924100c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add Grape content logger to log length and range

This commits adds another Grape logger. ContentLogger is going to long
content-length and content-range if provided.
parent 98c9897a
......@@ -25,7 +25,8 @@ module API
Gitlab::GrapeLogging::Loggers::QueueDurationLogger.new,
Gitlab::GrapeLogging::Loggers::PerfLogger.new,
Gitlab::GrapeLogging::Loggers::CorrelationIdLogger.new,
Gitlab::GrapeLogging::Loggers::ContextLogger.new
Gitlab::GrapeLogging::Loggers::ContextLogger.new,
Gitlab::GrapeLogging::Loggers::ContentLogger.new
]
allow_access_with_scope :api
......
# frozen_string_literal: true
module Gitlab
module GrapeLogging
module Loggers
class ContentLogger < ::GrapeLogging::Loggers::Base
def parameters(request, _)
{
content_length: request.env['CONTENT_LENGTH'],
content_range: request.env['HTTP_CONTENT_RANGE']
}.compact
end
end
end
end
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