From cd47701ba63fc77309066e27b73f50d0150e3e1b Mon Sep 17 00:00:00 2001 From: Alexander Sibiryakov Date: Sat, 10 Nov 2018 21:46:54 +0100 Subject: raising logging level on messages signalling data loss (#1553) --- kafka/producer/record_accumulator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kafka/producer/record_accumulator.py b/kafka/producer/record_accumulator.py index 84b01d1..728bf18 100644 --- a/kafka/producer/record_accumulator.py +++ b/kafka/producer/record_accumulator.py @@ -70,7 +70,8 @@ class ProducerBatch(object): return future def done(self, base_offset=None, timestamp_ms=None, exception=None): - log.debug("Produced messages to topic-partition %s with base offset" + level = logging.DEBUG if exception is None else logging.WARNING + log.log(level, "Produced messages to topic-partition %s with base offset" " %s and error %s.", self.topic_partition, base_offset, exception) # trace if self.produce_future.is_done: @@ -329,7 +330,7 @@ class RecordAccumulator(object): to_remove = [] if expired_batches: - log.debug("Expired %d batches in accumulator", count) # trace + log.warning("Expired %d batches in accumulator", count) # trace return expired_batches -- cgit v1.2.1