From debc460c9eb0309af624f73839feaef332d78a86 Mon Sep 17 00:00:00 2001 From: Imron Alston Date: Thu, 19 Apr 2018 02:43:14 +0000 Subject: [PATCH] fixed event emitter problem missed during 0.14->1.0 update --- VERSION | 2 +- lib/fluent/plugin/out_scalyr.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index ee94dd8..b60d719 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.3 +0.8.4 diff --git a/lib/fluent/plugin/out_scalyr.rb b/lib/fluent/plugin/out_scalyr.rb index b125e06..ebc4fab 100644 --- a/lib/fluent/plugin/out_scalyr.rb +++ b/lib/fluent/plugin/out_scalyr.rb @@ -29,6 +29,7 @@ module Scalyr class ScalyrOut < Fluent::Plugin::Output Fluent::Plugin.register_output( 'scalyr', self ) helpers :compat_parameters + helpers :event_emitter config_param :api_write_token, :string config_param :server_attributes, :hash, :default => nil @@ -321,8 +322,9 @@ def build_add_events_body( chunk ) rescue JSON::GeneratorError, Encoding::UndefinedConversionError => e $log.warn "#{e.class}: #{e.message}" - # Send the faulty event to a label @ERROR block and allow to handle it there (output to exceptions file for ex) - router.emit_error_event(tag, time, record, e) + # Send the faulty event to a label @ERROR block and allow to handle it there (output to exceptions file for ex) + time = Fluent::EventTime.new( sec, nsec ) + router.emit_error_event(tag, time, record, e) event[:attrs].each do |key, value| $log.debug "\t#{key} (#{value.encoding.name}): '#{value}'"