lib/lograge/formatters/logstash.rb in lograge-0.10.0 vs lib/lograge/formatters/logstash.rb in lograge-0.11.0
- old
+ new
@@ -1,12 +1,14 @@
module Lograge
module Formatters
class Logstash
+ include Lograge::Formatters::Helpers::MethodAndPath
+
def call(data)
load_dependencies
event = LogStash::Event.new(data)
- event['message'] = "[#{data[:status]}] #{data[:method]} #{data[:path]} (#{data[:controller]}##{data[:action]})"
+ event['message'] = "[#{data[:status]}]#{method_and_path_string(data)}(#{data[:controller]}##{data[:action]})"
event.to_json
end
def load_dependencies
require 'logstash-event'