Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug log to in_tail / buf_file. #2361

Merged
merged 2 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/fluent/plugin/buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -239,6 +239,7 @@ def expand_paths
false
end
rescue Errno::ENOENT
log.debug("#{p} is missing after refresh file list")
false
end
}
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down