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

29 May,2019 by Jack Vamvas

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 (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to create a log trace and send to file in Kafka


dba-ninja.com