Don't print the kafka-console-consumer warnings

前端 未结 2 1861
挽巷
挽巷 2021-01-06 01:04

I am trying to debug encrypted messages onto a Kafka cluster. Obviously these messages are full of non printable characters and are not usable on a console, so I wanted to s

2条回答
  •  离开以前
    2021-01-06 01:36

    There is a special logger config file for inbound console tools. Please, change the logger level from WARN to OFF in [kafka_home]/config/tools-log4j.properties file. The file should look like:

    tools-log4j.properties

    log4j.rootLogger=OFF, stdout 
    
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
    

    After it you will get only messages in console.

提交回复
热议问题