From 2397b9b1242c3a25cfc095421721b67133b5ee5c Mon Sep 17 00:00:00 2001 From: tpetr Date: Mon, 16 Oct 2017 13:13:59 -0400 Subject: [PATCH] log when a new file chunk has been created --- lib/fluent/plugin/buf_file.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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