diff --git a/lib/fluent/plugin/out_file.rb b/lib/fluent/plugin/out_file.rb index fe7dca4797..ae983c936a 100644 --- a/lib/fluent/plugin/out_file.rb +++ b/lib/fluent/plugin/out_file.rb @@ -223,7 +223,12 @@ def write(chunk) def write_without_compression(path, chunk) File.open(path, "ab", @file_perm) do |f| - chunk.write_to(f) + if @append + content = chunk.read() + f.puts content + else + chunk.write_to(f) + end end end