Commit ba9eb61c authored by Stan Hu's avatar Stan Hu

Merge branch 'feature/gb/trace-patch-range-logs' into 'master'

Add Grape content logger to log content length and range

See merge request gitlab-org/gitlab!46128
parents 81d26eb5 4924100c
...@@ -25,7 +25,8 @@ module API ...@@ -25,7 +25,8 @@ module API
Gitlab::GrapeLogging::Loggers::QueueDurationLogger.new, Gitlab::GrapeLogging::Loggers::QueueDurationLogger.new,
Gitlab::GrapeLogging::Loggers::PerfLogger.new, Gitlab::GrapeLogging::Loggers::PerfLogger.new,
Gitlab::GrapeLogging::Loggers::CorrelationIdLogger.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 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