Skip to content


Kafka Streams uses Simple Logging Facade for Java (SLF4J) for logging.

Among the logging frameworks supported by slf4j is Apache Log4j that is used by Apache Kafka by default.

Library Dependencies

Use slf4j-api and slf4j-log4j12 library dependencies in a Kafka Streams application (in build.sbt) for logging.

val slf4jVersion = "2.0.0-alpha5"
libraryDependencies += "org.slf4j" % "slf4j-api" % slf4jVersion
libraryDependencies += "org.slf4j" % "slf4j-log4j12" % slf4jVersion

Use the following in src/main/resources in your Kafka Streams application's project.

log4j.rootLogger=INFO, stdout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
Back to top