current position:Home>Add configuration logback XML solves the problem that Kafka producers and consumers keep printing logs

Add configuration logback XML solves the problem that Kafka producers and consumers keep printing logs

2022-01-27 03:21:02 zhengzaifeidelushang

Increase the configuration logback.xml solve kafka producer 、 The consumer keeps printing logs

pom.xml introduce kafak rely on , Increase the configuration logback.xml, Set the log level , solve kafka producer 、 The consumer keeps printing logs

		<dependency>
			<groupId>org.apache.kafka</groupId>
			<artifactId>kafka-clients</artifactId>
			<version>2.7.2</version>
		</dependency>

logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <logger name="org.apache.kafka.clients" level="info" />
</configuration>

After adding configuration ,kafka producer 、 Consumer output no longer prints logs , Output only key information
 Insert picture description here

copyright notice
author[zhengzaifeidelushang],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270321006384.html

Random recommended