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
This commit is contained in:
commit
607f63f8a8
1 changed files with 6 additions and 1 deletions
|
@ -12,9 +12,14 @@ unless Sidekiq.server?
|
||||||
config.lograge.logger = ActiveSupport::Logger.new(filename)
|
config.lograge.logger = ActiveSupport::Logger.new(filename)
|
||||||
# Add request parameters to log output
|
# Add request parameters to log output
|
||||||
config.lograge.custom_options = lambda do |event|
|
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 = {
|
payload = {
|
||||||
time: event.time.utc.iso8601(3),
|
time: event.time.utc.iso8601(3),
|
||||||
params: event.payload[:params].except(*%w(controller action format)),
|
params: params,
|
||||||
remote_ip: event.payload[:remote_ip],
|
remote_ip: event.payload[:remote_ip],
|
||||||
user_id: event.payload[:user_id],
|
user_id: event.payload[:user_id],
|
||||||
username: event.payload[:username]
|
username: event.payload[:username]
|
||||||
|
|
Loading…
Reference in a new issue