From 4142a7b9c6e9f7b4f6719b7893303139ce9a39c9 Mon Sep 17 00:00:00 2001 From: Masahiro Nakagawa Date: Tue, 2 Apr 2019 08:01:07 +0900 Subject: [PATCH 1/2] Add more debug message for file check Signed-off-by: Masahiro Nakagawa --- lib/fluent/plugin/buf_file.rb | 2 ++ lib/fluent/plugin/in_tail.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index 1faabb286c..04fc24394e 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -133,6 +133,8 @@ def resume Dir.glob(patterns) do |path| next unless File.file?(path) + log.debug { "restoring buffer file: path = #{path}" } + m = new_metadata() # this metadata will be overwritten by resuming .meta file content # so it should not added into @metadata_list for now mode = Fluent::Plugin::Buffer::FileChunk.assume_chunk_state(path) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 062fbc1366..4186f27841 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -239,6 +239,7 @@ def expand_paths false end rescue Errno::ENOENT + log.debug("#{p} is missing after refresh file list") false end } @@ -260,6 +261,8 @@ def refresh_watchers target_paths = expand_paths existence_paths = @tails.keys + log.debug { "tailing paths: target = #{target_paths.join(",")} | existing = #{existence_paths.join(",")}" } + unwatched = existence_paths - target_paths added = target_paths - existence_paths @@ -337,7 +340,7 @@ def close_watcher_handles def update_watcher(path, pe) if @pf unless pe.read_inode == @pf[path].read_inode - log.trace "Skip update_watcher because watcher has been already updated by other inotify event" + log.debug "Skip update_watcher because watcher has been already updated by other inotify event" return end end From 3338d5e679f91e144b0d653c2a550c22d88accd3 Mon Sep 17 00:00:00 2001 From: Masahiro Nakagawa Date: Tue, 2 Apr 2019 08:02:06 +0900 Subject: [PATCH 2/2] in_tail: Fix check condition for encoding Signed-off-by: Masahiro Nakagawa --- lib/fluent/plugin/in_tail.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 4186f27841..d054d109f9 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -171,7 +171,7 @@ def configure_encoding @encoding = parse_encoding_param(@encoding) if @encoding @from_encoding = parse_encoding_param(@from_encoding) if @from_encoding - if @encoding == @from_encoding + if @encoding && (@encoding == @from_encoding) log.warn "'encoding' and 'from_encoding' are same encoding. No effect" end end