I downloaded kafka-clients-0.9.0.0.jar with maven and i expect i would see logging like those in this link Kafka Logging
However i have no idea why i am not getting any logging, even I set the bootstrap.servers wrongly on purpuse, but it just got stuck without throwing any warning. I added a few lines of code to print to a file using log4j and it seems work but no idea why Kafka cannot log event to log4j.
import org.apache.log4j.Logger;
public class ConsumerLoop implements Runnable {
final static Logger logger = Logger.getLogger(ConsumerLoop.class);
@Override
public void run() {
logger.warn("running!!!!!");
}
}
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2016-04-04 12:54:01 WARN ConsumerLoop:40 - running!!!!!
Note, there is slf4j-api-1.7.6.jar that came as a dependency of kafka. Even I included the required library slf4j-api-x.x.x.jar, slf4j-log4jx-x.x.x.jar and used slf4j to log even but still cannot get the kafka logs.