关闭spring整合kafka时,消费者一直打印kafka日志 - httpslly - 博客园

在log4j.properties中添加如下代码

复制代码; "复制代码")

log4j.logger.org.apache.kafka.common.metrics.Metrics=OFF
log4j.logger.org.apache.kafka.clients.FetchSessionHandler=OFF
log4j.logger.org.apache.kafka.clients.consumer.internals.Fetcher=OFF
log4j.logger.org.apache.kafka.clients.consumer.internals.AbstractCoordinator=OFF
log4j.logger.org.apache.kafka.clients.consumer.internals.ConsumerCoordinator=OFF
log4j.logger.org.springframework.kafka.listener.KafkaMessageListenerContainer=OFF
log4j.logger.org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer=OFF

复制代码; "复制代码")

说明:

log4j.logger.**XXX=OFF
XXX**,表示需要调整输出日志级别的类全名(如:org.apache.kafka.common.metrics.Metrics),等号后面表示日志级别


Original url: Access
Created at: 2019-12-25 10:39:07
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共0条评论