kafka-console-producer.sh (kafka_2.10-0.8.1) reported SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”

On my Mac box, after download the scala-2.10 and kafka_2.10-0.8.1,  in the kafka_2.10-0.8.1 directory, every thins is fine when I start zookeeper, kafka server, and create a test topic.  Then I need to start a producer for the test topic. but there is an error:

 yhuangMac:kafka_2.10-0.8.1 yhuang$ ./bin/kafka-console-producer.sh –broker-list localhost:9092 –topic test
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.

The reason is that in the kafka libs directory, the kafka release zip file only included jar file of slf4j-api, they missed a jar file: slf4j-nop.jar, so we have to go to http://www.slf4j.org download slf4j-1.7.7.zip, and then unzip it, copy the slf4j-api-1.7.7, slf4j-nop-1.7.7.jar into kafka’s libs directory. restart kafka producer again, now no error is reported.

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to kafka-console-producer.sh (kafka_2.10-0.8.1) reported SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”

  1. Zahava Abudi says:

    Finally a working solution that includes all the directions!
    Thank you so much!!!

  2. Ivan G says:

    It simply works like a charm, Thank you very much!

  3. Jason C says:

    Thanks for sharing. This solved my problem.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s