lib/logstasher/active_support/log_subscriber.rb in logstasher-0.9.0 vs lib/logstasher/active_support/log_subscriber.rb in logstasher-1.0.0
- old
+ new
@@ -1,11 +1,14 @@
require 'active_support/core_ext/class/attribute'
require 'active_support/log_subscriber'
+require 'logstasher/custom_fields'
module LogStasher
module ActiveSupport
class LogSubscriber < ::ActiveSupport::LogSubscriber
+ include CustomFields::LogSubscriber
+
def process_action(event)
payload = event.payload
data = extract_request(payload)
data.merge! extract_status(payload)
@@ -92,14 +95,9 @@
message = "#{exception}\n#{message}\n#{backtrace}"
{ :status => status, :error => message }
else
{}
end
- end
-
- def extract_custom_fields(payload)
- custom_fields = (!LogStasher.custom_fields.empty? && payload.extract!(*LogStasher.custom_fields)) || {}
- custom_fields
end
end
end
end