From e80d5327a03271a46d646820bf50d594241a1988 Mon Sep 17 00:00:00 2001 From: Masahiro Nakagawa Date: Wed, 22 Jul 2020 02:34:09 +0900 Subject: [PATCH] buffer: Fix log message for chunk_limit_records case. fix #3072 Signed-off-by: Masahiro Nakagawa --- lib/fluent/plugin/buffer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/buffer.rb b/lib/fluent/plugin/buffer.rb index 5b08e19444..fdb9aa9981 100644 --- a/lib/fluent/plugin/buffer.rb +++ b/lib/fluent/plugin/buffer.rb @@ -604,7 +604,11 @@ def write_once(metadata, data, format: nil, size: nil, &block) if chunk_size_over?(chunk) if format && empty_chunk - log.warn "chunk bytes limit exceeds for an emitted event stream: #{adding_bytesize}bytes" + if chunk.bytesize > @chunk_limit_size + log.warn "chunk bytes limit exceeds for an emitted event stream: #{adding_bytesize}bytes" + else + log.warn "chunk size limit exceeds for an emitted event stream: #{chunk.size}records" + end end chunk.rollback