DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
The logging library used in the tools module is inconsistent with the core. Now, slf4j2.x provides a cleaner and simpler more straightforward approach.
By adding slf4j backends to dependencies, distributions will have their own 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.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
More importantly, specifying the provider class explicitly via the slf4j.provider system property bypasses the service loader mechanism for finding providers and may shorten SLF4J initialization.
Public Interfaces
Update the below to upgrade slf4j, starting with the 4.1.0 version.
...
- Upgrade slf4j from 1.7.36 to 2.0.9+17
- Add a new system variable to the
kafka-run-class(sh & bat) script to define-Dslf4j.provider.- By default, we use
org.apache.logging.slf4j.
SLF4JServiceProvider- reference: https://www.slf4j.org/faq.html#explicitProvider
- Add other popular slf4j backend binding provider dependencies, e.g.,
logback
Compatibility, Deprecation, and Migration Plan
Make sure Ensure the user's code works well when they provide their own slf4j jarsspecifying their preferred logging frameworks.
If We will provide compatible binding jars for log4j2 in Kafka when slf4j-api is upgraded upgrading to 2.0.9, we also provide compatible binding jars for log4j2 logging in Kafka itself.17
As we introduce this change in major version 4.1.0, it since we provide the backend binding dependencies, users should be ok for users able 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 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.
Test Plan
We have to imitate Imitate the user's behavior by manually adding or replacing the dependent log logging jars and assigning the corresponding environment system property by -Dslf4j.provider .
After that, try to start starting a Kafka service and see if there is are any warning warnings or errorerrors. Make sure Kafka still usually works normally after changing the log logging framework.
Rejected Alternatives
...