Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Compatibility, Deprecation, and Migration Plan

Logging configuration file compatibility

At some time or other, the default logging configuration format will be switched into log4j2. In that point, the informational message launcher scripts of core, connect, and raft raft will be also changed into like the following:

Code Block
languagebash
Using log4j 2.x configuration. To use log4j 1.x configuration, run with: 'export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"'

Root Logger name compatibility

Apache Kafka 3.9.0 supports dynamic logger configuration features for Broker and Connect servers. (below) Since these features were originally designed for log4j 1.x, it uses 'root' for the root logger's name.

Code Block
languagebash
# Kafka broker dynamic configuration
bin/kafka-configs.sh --bootstrap-server {kafka-cluster-endpoint} \
            --entity-type broker-loggers --entity-name {broker-id} \
            --alter --add-config {logger-name}=TRACE

# Kafka connect REST API
curl -s -X PUT -H "Content-Type:application/json" \
    http://{kafka-connect-endpoint}/admin/loggers/{logger-name} \
    -d '{"level": "TRACE"}'

Although log4j2 changed its root logger name to '' (empty string) but, the root logger name will remain AS-IS for the following reasons:

  1. Kafka Connect's REST API can't support it, for /admin/loggers is already used for the other purpose.
  2. From the user's perspective, defining a 'root' named not-root logger is unreasonable. The logger names generally follow {package-name}.{class-name} form. So, concerning this scenario is not practical nor realistic.

So, we will keep the root logger's name as 'root' even with log4j2.

Rejected Alternatives

Following log4j2's root logger name (empty string)

It breaks API compatibility and removes the ability to control the root logger. (REST API inherently assume every resource has a non-empty name.) So rejected.

Co-work note

This KIP was initially proposed, designed, and worked by Lee Dongjin, but TengYao Chi finalized the implementationNone.