lib/logstasher/action_view/log_subscriber.rb in logstasher-0.9.0 vs lib/logstasher/action_view/log_subscriber.rb in logstasher-1.0.0
- old
+ new
@@ -1,11 +1,14 @@
require 'active_support/notifications'
require 'action_view/log_subscriber'
+require 'logstasher/custom_fields'
module LogStasher
module ActionView
class LogSubscriber < ::ActionView::LogSubscriber
+ include CustomFields::LogSubscriber
+
def render_template(event)
logstash_event(event)
end
alias :render_partial :render_template
alias :render_collection :render_template
@@ -55,15 +58,9 @@
duration: event.duration,
}.inject({}) do |runtimes, (name, runtime)|
runtimes[name] = runtime.to_f.round(2) if runtime
runtimes
end
-
- end
-
- def extract_custom_fields(data)
- custom_fields = (!LogStasher.custom_fields.empty? && data.extract!(*LogStasher.custom_fields)) || {}
- custom_fields
end
end
end
end