Current state: Under Discussion
Discussion thread: here
Vote thread: here
JIRA:
More discussions: https://github.com/apache/kafka/pull/16260#issuecomment-2159632052
The logging library used in the tools module is inconsistent with the core. Now, slf4j2.x provides a cleaner and more straightforward approach.
By adding slf4j backends to dependencies, distributions will have their slf4j backends, and it is safe to define a slf4j provider in kafka-run-class. This also allows running a Kafka instance from the source code with a specific provider.
More importantly, this change will bring 2 benefits:
slf4j.provider system property bypasses the service loader mechanism for finding providers and may shorten SLF4J initialization.Update the below to upgrade slf4j, starting with the 4.1.0 version.
dependencies.gradle build.gradle kafka-run-class (sh & bat) script to define -Dslf4j.provider.org.apache.logging.slf4j.SLF4JServiceProvider logback Ensure the user's code works well when specifying their preferred logging frameworks.
We will provide compatible binding jars for log4j2 in Kafka when slf4j-api upgrading to 2.0.17
As we introduce this change in major version 4.1.0, since we provide the backend binding dependencies, users should be able to upgrade their backend dependencies.
Please note that users have to upgrade their logging framework to the matched provider explicitly, and we expect users to be responsible for keeping a consistent version when using other providers.
For future slf4j upgrade: In the future, for slf4j upgrades, we agree not to have a KIP again and follow the same approach mentioned in this KIP.
Imitate the user's behavior by manually adding or replacing the dependent logging jars and assigning the corresponding system property by -Dslf4j.provider .
After that, try starting a Kafka service and see if there are any warnings or errors. Make sure Kafka still usually works after changing the logging framework.
N/A