class Fluent::Plugin::CopyExOutput

Attributes

ignore_errors[R]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_copy_ex/v14.rb, line 9
def initialize
  super
  @ignore_errors = []
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_copy_ex/v14.rb, line 14
def configure(conf)
  super

  conf.elements.select {|e|
    e.name == 'store'
  }.each {|e|
    @ignore_errors << (e.arg == "ignore_error")
  }
end
process(tag, es) click to toggle source
# File lib/fluent/plugin/out_copy_ex/v14.rb, line 24
def process(tag, es)
  unless es.repeatable?
    m = Fluent::MultiEventStream.new
    es.each {|time,record|
      m.add(time, record)
    }
    es = m
  end

  outputs.each.with_index do |output, idx|
    begin
      output.emit_events(tag, @deep_copy ? es.dup : es)
    rescue => e
      if @ignore_errors[idx]
        log.error :error_class => e.class, :error => e.message
      else
        raise e
      end
    end
  end
end