Skip to content

Commit

Permalink
Add custom fields to payload AFTER action is called
Browse files Browse the repository at this point in the history
related issues
- Add custom fields to payload AFTER action is called [shadabahmed#24](shadabahmed#24)
- Custom fields to payload after action is called no longer working? [shadabahmed#102](shadabahmed#102)
  • Loading branch information
Jadeno authored Oct 18, 2016
1 parent 0285c8d commit cebf114
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def process_action(*args)
logstasher_add_custom_fields_to_request_context(LogStasher.request_context)
end

result = super

if self.respond_to?(:logtasher_add_custom_fields_to_payload)
before_keys = raw_payload.keys.clone
logtasher_add_custom_fields_to_payload(raw_payload)
Expand All @@ -31,8 +33,6 @@ def process_action(*args)
LogStasher::CustomFields.add(*(after_keys - before_keys))
end

result = super

payload[:status] = response.status
append_info_to_payload(payload)
LogStasher.store.each do |key, value|
Expand Down

0 comments on commit cebf114

Please sign in to comment.