From 955cee5681f2c1cb375364a421ac1bdc2364e811 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Mon, 8 Jul 2024 12:14:02 +0900 Subject: [PATCH] improve debug message Signed-off-by: Daijiro Fukuda Co-authored-by: Takuro Ashie --- lib/fluent/plugin/in_tail.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 8861cc015e..6a83075cc5 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -1064,7 +1064,11 @@ def read_lines(lines) if is_long_line @log.warn "received line length is longer than #{@max_line_size}" - @log.debug("skipped line: ") { convert(rbuf).chomp } + if @skip_current_line + @log.debug("The continuing line is finished. Finally discarded data: ") { convert(rbuf).chomp } + else + @log.debug("skipped line: ") { convert(rbuf).chomp } + end has_skipped_line = true @skip_current_line = false @skipping_current_line_bytesize = 0 @@ -1079,6 +1083,11 @@ def read_lines(lines) ) if is_long_current_line + @log.debug( + "The continuing current line length is longer than #{@max_line_size}." + + " The received data will be discarded until this line is finished." + + " Discarded data: " + ) { convert(@buffer).chomp } @skip_current_line = true @skipping_current_line_bytesize += @buffer.bytesize @buffer.clear