lib/logstasher/rails_ext/action_controller/base.rb in logstasher-0.9.0 vs lib/logstasher/rails_ext/action_controller/base.rb in logstasher-1.0.0
- old
+ new
@@ -5,10 +5,11 @@
add_custom_fields_to_store
LogStasher.clear_request_context
LogStasher.add_default_fields_to_request_context(request)
super(*args)
+ LogStasher::CustomFields.clear
end
private
# this method is called from within super of process_action.
@@ -21,10 +22,10 @@
if self.respond_to?(:logtasher_add_custom_fields_to_payload)
before_keys = payload.keys.clone
logtasher_add_custom_fields_to_payload(payload)
after_keys = payload.keys
# Store all extra keys added to payload hash in payload itself. This is a thread safe way
- LogStasher.custom_fields += after_keys - before_keys
+ LogStasher::CustomFields.add(*(after_keys - before_keys))
end
payload[:status] = response.status
super(payload)