java - Kafka: How do I enable client logging? -


when instantiate kafka consumer

kafkaconsumer<string,string> consumer = new kafkaconsumer<string,string>(props); 

i message

slf4j: failed load class "org.slf4j.impl.staticloggerbinder". slf4j: defaulting no-operation (nop) logger implementation slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details. 

how enable logging client program?

add property file src/main/resources/log4j.properties project:

$ cat src/main/resources/log4j.properties  # root logger option log4j.rootlogger=debug, stdout  # direct log messages stdout log4j.appender.stdout=org.apache.log4j.consoleappender log4j.appender.stdout.target=system.out log4j.appender.stdout.layout=org.apache.log4j.patternlayout log4j.appender.stdout.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n 

this enable logging. can set standard options such debug level, output format, etc, per logging documentation.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -