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 simpler approach.
By adding slf4j backends to dependencies, distributions will have their own slf4j backends, and it is safe to define a slf4j provider in run-class. This also allows running a Kafka instance from the source code with a specific provider.
Avoid compatibility issues: The version of the slf4j provider must be equal to the slf4j API (https://www.slf4j.org/manual.html#compatibility). Including both in Kafka distribution can avoid compatibility issues.
Update the below to upgrade slf4j, starting with the 4.1.0 version.
dependencies.gradle build.gradle -Dslf4j.provider. By default, we use `org.apache.logging.slf4j.SLF4JServiceProvider`Make sure the user's code works well when they provide their own slf4j jars
If slf4j-api is upgraded to 2.0.9, we also provide compatible binding jars for log4j2 logging in Kafka itself. As we introduce this change in major version 4.1.0, it should be ok for users to upgrade their backend dependencies, and we can also provide compatible backend dependencies.
This way, users get an upgraded logging library.
Please note that users have to upgrade 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.
We have to imitate the user's behavior by manually replacing the dependent log jars and assigning the corresponding environment property.
After that, try to start a Kafka service and see if there is any warning or error. Make sure Kafka still works normally after changing the log framework.
N/A