lib/fluent/plugin/in_tail.rb in fluentd-1.1.1 vs lib/fluent/plugin/in_tail.rb in fluentd-1.1.2
- old
+ new
@@ -578,9 +578,11 @@
@io_handler.close
elsif !@io_handler.opened? # There is no previous file. Reuse TailWatcher
@pe.update(inode, 0)
else # file is rotated and new file found
watcher_needs_update = true
+ # Handle the old log file before renewing TailWatcher [fluentd#1055]
+ @io_handler.on_notify
end
else # file is rotated and new file not found
# Clear RotateHandler to avoid duplicated file watch in same path.
@rotate_handler = nil
watcher_needs_update = true