diff --git a/lib/logstash/outputs/file.rb b/lib/logstash/outputs/file.rb index 7941b4d..6961899 100644 --- a/lib/logstash/outputs/file.rb +++ b/lib/logstash/outputs/file.rb @@ -246,8 +246,8 @@ def open(path) if deleted?(path) if @create_if_deleted - @logger.debug("Required path was deleted, creating the file again", :path => path) - @files.delete(path) + @logger.debug("Required path was deleted, creating the file again, and releasing old handle", :path => path) + @files.delete(path).close if cached?(path) else return @files[path] if cached?(path) end