diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-28 00:48:03 -0500 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-28 00:48:03 -0500 |
commit | 9bc176b2c39f1c27ce8ed4c13cf06e53331c16c9 (patch) | |
tree | 4e9ebd96d3b43be8c99f6afdad5296dfbaef55e6 /config/initializers | |
parent | 02b25598cbedaaec96d8c9e52de7f969a5eb71a1 (diff) | |
download | gitlab-ce-9bc176b2c39f1c27ce8ed4c13cf06e53331c16c9.tar.gz |
Add remote IP, user ID and username to JSON lograge outputsh-augment-lograge-output
This makes the logs a bit more useful to search requests by users.
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/lograge.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index c9a515dfcd5..21fe8d72459 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -14,7 +14,10 @@ unless Sidekiq.server? config.lograge.custom_options = lambda do |event| { time: event.time.utc.iso8601(3), - params: event.payload[:params].except(%w(controller action format)) + params: event.payload[:params].except(*%w(controller action format)), + remote_ip: event.payload[:remote_ip], + user_id: event.payload[:user_id], + username: event.payload[:username] } end end |