lib/fluent/plugin/in_cat_sweep.rb in fluent-plugin-cat-sweep-0.1.0 vs lib/fluent/plugin/in_cat_sweep.rb in fluent-plugin-cat-sweep-0.1.1

- old
+ new

@@ -88,11 +88,11 @@ next unless will_process?(filename) processing_filename = get_processing_filename(filename) begin lock_with_renaming(filename, processing_filename) do - process(processing_filename) + process(filename, processing_filename) after_processing(processing_filename) end rescue => e log.error "in_cat_sweep: processing: #{processing_filename}", :error => e, :error_class => e.class log.error_backtrace @@ -194,14 +194,15 @@ router.emit(@tag, time, record) end end end - def process(filename) - File.open(filename, 'r') do |tfile| + def process(original_filename, processing_filename) + File.open(processing_filename, 'r') do |tfile| read_each_line(tfile) do |line| emit_message(line) end + log.debug { %[in_cat_sweep: process: {filename:"#{original_filename}",size:#{tfile.size}}] } end end def lock_with_renaming(filename_from, filename_to) file = File.open(filename_from)