diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-09 21:12:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-09 21:12:44 +0300 |
commit | 26dd7eec86080ea304eae663500455b96bbcfa1b (patch) | |
tree | 7ed2608f60ce7805a9ead423d747b9439476bbe8 /lib/gitlab | |
parent | 0eb9c236888a832407bf0369ce188c4060a35c76 (diff) |
Add latest changes from gitlab-org/gitlab@16-2-stable-ee
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/grape_logging/loggers/response_logger.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/lograge/custom_options.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/grape_logging/loggers/response_logger.rb b/lib/gitlab/grape_logging/loggers/response_logger.rb index b87566a62b0..767c282d62e 100644 --- a/lib/gitlab/grape_logging/loggers/response_logger.rb +++ b/lib/gitlab/grape_logging/loggers/response_logger.rb @@ -5,6 +5,8 @@ module Gitlab module Loggers class ResponseLogger < ::GrapeLogging::Loggers::Base def parameters(_, response) + return {} unless Feature.enabled?(:log_response_length) + response_bytes = 0 case response diff --git a/lib/gitlab/lograge/custom_options.rb b/lib/gitlab/lograge/custom_options.rb index 9abad44b10e..f8ec58cf217 100644 --- a/lib/gitlab/lograge/custom_options.rb +++ b/lib/gitlab/lograge/custom_options.rb @@ -36,6 +36,10 @@ module Gitlab payload[:feature_flag_states] = Feature.logged_states.map { |key, state| "#{key}:#{state ? 1 : 0}" } end + if Feature.disabled?(:log_response_length) + payload.delete(:response_bytes) + end + payload end end |