DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
| Table of Contents |
|---|
This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Status
Current state: "Under Discussion"
Discussion thread: here
Vote thread: here
...
More discussions: https://github.com/apache/kafka/pull/16260#issuecomment-2159632052
Logging The logging library used in the tools module is inconsistent with the core. slf4j2.x provides a cleaner and simpler approach.
By adding slf4j backends to dependencies, distributions will have their own slf4j backends, and its it is safe to define a slf4j provider in run-class. This allows to run kafka also allows running a Kafka instance from the source code with a specific provider too.
Avoid compatibility issue issues: The version of the slf4j provider must be equal to the slf4j API (https://www.slf4j.org/manual.html#compatibility). Including Including both in kafka Kafka distribution can avoid compatibility issue;issues.
Public Interfaces
Update the below to upgrade slf4j, starting with the 4.1.0 version.
dependencies.gradle
build.gradle
Proposed Changes
- Upgrade slf4j from 1.7.36 to 2.0.9+
- Add a new system variable to the run-class (sh & bat) script to define -Dslf4j.provider. By default, we use `org.apache.logging.slf4j.reload4j.Reload4jServiceProvider.SLF4JServiceProvider`
- Add other slf4j backend binding dependencies
Compatibility, Deprecation, and Migration Plan
Make sure users 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 the compatible binding jars for reload4j for log4j2 logging in kafka Kafka itself. As we introduce this change in major version 4.01.0, this it should be ok for users to upgrade their backend dependencies, and we can also provide the 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 have responsibility to keep 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 not have a KIP again , and follow the same approach mentioned in this kipKIP.
Test Plan
Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?
Rejected Alternatives
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.
Rejected Alternatives
N/AIf there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.