Commit e62a6cca authored by Andrew Newdigate's avatar Andrew Newdigate Committed by Stan Hu

Fix for open-ended parameter's in lograge causing elastic memory issues

parent ff2f57da
...@@ -12,9 +12,14 @@ unless Sidekiq.server? ...@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment