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

Do not warn that directories are unreadable in the in_tail plugin. #1540

Merged
merged 3 commits into from
Apr 12, 2017
Merged
Changes from 2 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
7 changes: 5 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,17 @@ def expand_paths
path = date.strftime(path)
if path.include?('*')
paths += Dir.glob(path).select { |p|
if File.readable?(p) && !File.directory?(p)
is_directory = File.directory?(p)
Copy link
Member

@repeatedly repeatedly Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_file = !File.directory?(p) is better for removing every ! from is_directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if File.readable?(p) && !is_directory
if @limit_recently_modified && File.mtime(p) < (date - @limit_recently_modified)
false
else
true
end
else
log.warn "#{p} unreadable. It is excluded and would be examined next time."
if !is_directory
log.warn "#{p} unreadable. It is excluded and would be examined next time."
end
false
end
}
Expand Down