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