How to create a log trace and send to file in Kafka

29 May,2019 by

Question: How can I create a trace log file in Kafka  ?  I want to set the logger level to TRACE  , sending the trace details to a file.

Answer: To change from the current Kafka Connect logging level to the TRACE , you’ll need to edit the connect-log4j.properties and restart Connect

edit - $(confluent_home)/etc/kafka/connect-log4j.properties


log4j.rootLogger=TRACE, traceFile, stdout
log4j.appender.traceFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.traceFile.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.traceFile.File=/tmp/kafka-connect-trace.log
log4j.appender.traceFile.layout=org.apache.log4j.PatternLayout
log4j.appender.traceFile.layout.ConversionPattern=[%d] %p %m (%c)%n

You’ll need to restart Connect for the changes to take effect

Author: Jack Vamvas

Leave a Reply

Discover more from ciquery

Subscribe now to keep reading and get access to the full archive.

Continue reading