diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index 163d1e1f5a..46670ab24f 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -170,10 +170,14 @@ def resume def generate_chunk(metadata) # FileChunk generates real path with unique_id if @file_permission - Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, perm: @file_permission, compress: @compress) + chunk = Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, perm: @file_permission, compress: @compress) else - Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, compress: @compress) + chunk = Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, compress: @compress) end + + log.debug "Created new chunk", chunk_id: dump_unique_id_hex(chunk.unique_id), metadata: metadata + + return chunk end end end