class Fluent::Plugin::BinInput

Public Instance Methods

convert_line_to_event(line, es, tail_watcher) click to toggle source
# File lib/fluent/plugin/in_bin.rb, line 25
def convert_line_to_event(line, es, tail_watcher)
  begin
    es.add(nil, line)
  rescue => e
    log.warn line.dump, error: e.to_s
    log.debug_backtrace(e.backtrace)
  end
end
setup_watcher(path, pe) click to toggle source
# File lib/fluent/plugin/in_bin.rb, line 34
def setup_watcher(path, pe)
  line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil
  tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher,  &method(:receive_lines))
  tw.attach do |watcher|
     timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer
     event_loop_attach(watcher.stat_trigger)
  end
  tw
end