diff options
author | Stan Hu <stanhu@gmail.com> | 2018-02-28 18:45:42 +0300 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-03-07 01:21:22 +0300 |
commit | d00802fa1ed1729e8ef0a485e62a5ef9ac84e990 (patch) | |
tree | 3d17adc57b5dccd367d2de0cb63fa0d0a91d6f10 /config | |
parent | b67bac5699a8b48f2406ef7d480af5b40db1294f (diff) |
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
Diffstat (limited to 'config')
-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] |