diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /config/initializers/lograge.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'config/initializers/lograge.rb')
-rw-r--r-- | config/initializers/lograge.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index e3601a9538e..74b6218bf53 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -17,6 +17,13 @@ unless Gitlab::Runtime.sidekiq? data[:duration_s] = Gitlab::Utils.ms_to_round_sec(data.delete(:duration)) if data[:duration] data.merge!(::Gitlab::Metrics::Subscribers::ActiveRecord.db_counter_payload) + # Remove empty hashes to prevent type mismatches + # These are set to empty hashes in Lograge's ActionCable subscriber + # https://github.com/roidrage/lograge/blob/v0.11.2/lib/lograge/log_subscribers/action_cable.rb#L14-L16 + %i(method path format).each do |key| + data[key] = nil if data[key] == {} + end + data end |