We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf92357 commit e2ce341Copy full SHA for e2ce341
lib/logstash/outputs/file.rb
@@ -220,14 +220,13 @@ def deleted?(path)
220
def open(path)
221
if !deleted?(path) && cached?(path)
222
return @files[path]
223
- elsif deleted?(path)
224
- if @create_if_deleted
225
- @logger.debug("Required path was deleted, creating the file again", :path => path)
226
- @files.delete(path)
227
- else
228
- return @files[path] if cached?(path)
229
- end
+ elsif @create_if_deleted && deleted?(path)
+ @logger.debug("Required path was deleted, creating the file again", :path => path)
+ @files.delete(path)
+ else
+ return @files[path] if cached?(path)
230
end
+
231
@logger.info("Opening file", :path => path)
232
233
dir = File.dirname(path)
0 commit comments