diff options
author | Stan Hu <stanhu@gmail.com> | 2018-02-28 15:45:42 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-02-28 15:45:42 +0000 |
commit | 607f63f8a841b601cdc28ca11fcfcc21c76f3e8c (patch) | |
tree | ef80c1fcc02851c2d039cf587149b6b454001e5c | |
parent | ff2f57da791890957fe97efd46f5c34f270a0c46 (diff) | |
parent | e62a6cca0842d1b876cd1743e06ffcd14a12339f (diff) | |
download | gitlab-ce-607f63f8a841b601cdc28ca11fcfcc21c76f3e8c.tar.gz |
Merge branch 'an/lograge-fix' into 'master'
Fix for open-ended parameter's in lograge causing elastic memory issues
See merge request gitlab-org/gitlab-ce!17419
-rw-r--r-- | config/initializers/lograge.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 8560d24526f..114c1cb512f 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -12,9 +12,14 @@ unless Sidekiq.server? config.lograge.logger = ActiveSupport::Logger.new(filename) # Add request parameters to log output config.lograge.custom_options = lambda do |event| + params = event.payload[:params] + .except(*%w(controller action format)) + .each_pair + .map { |k, v| { key: k, value: v } } + payload = { time: event.time.utc.iso8601(3), - params: event.payload[:params].except(*%w(controller action format)), + params: params, remote_ip: event.payload[:remote_ip], user_id: event.payload[:user_id], username: event.payload[:username] |