lib/logstasher/active_support/log_subscriber.rb in logstasher-2.1.1 vs lib/logstasher/active_support/log_subscriber.rb in logstasher-2.1.2

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'active_support/core_ext/class/attribute' require 'active_support/log_subscriber' require 'logstasher/custom_fields' module LogStasher @@ -18,11 +20,11 @@ data.merge! LogStasher.store data.merge! extract_custom_fields(payload) tags = ['request'] tags.push('exception') if payload[:exception] - logger << LogStasher.build_logstash_event(data, tags).to_json + "\n" + logger << "#{LogStasher.build_logstash_event(data, tags).to_json}\n" end def redirect_to(event) Thread.current[:logstasher_location] = event.payload[:location] end @@ -46,14 +48,10 @@ def extract_path(payload) payload[:path].split('?').first end def extract_format(payload) - if ::ActionPack::VERSION::MAJOR == 3 && ::ActionPack::VERSION::MINOR == 0 - payload[:formats].first - else - payload[:format] - end + payload[:format] end def extract_status(payload) if payload[:status] { status: payload[:status].to_i }