kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Remove unnecessary log4j-appender dependency and tweak explicit log4j dependency

Open ijuma opened this issue 3 years ago • 3 comments

  • Remove log4j-appender dependency from tools, trogdor and shell
  • Remove explicit log4j dependency from trogdor and tools.
  • Add compileOnly dependency from tools to log4j (same approach as core).

Committer Checklist (excluded from commit message)

  • [ ] Verify design and implementation
  • [ ] Verify test coverage and CI build status
  • [ ] Verify documentation (including upgrade notes)

ijuma avatar May 11 '22 14:05 ijuma

@cmccabe is there any reason why shell and trogdor need log4j-appender?

ijuma avatar May 11 '22 14:05 ijuma

@omkreddy maybe you can help review this.

ijuma avatar Jun 15 '22 17:06 ijuma

@ijuma sorry missed this. Can you rebase the PR.

omkreddy avatar Sep 20 '22 06:09 omkreddy

@omkreddy Rebased.

ijuma avatar Oct 14 '22 14:10 ijuma

@ijuma can you rebase this PR? I think removing the unnecessary log4j-appender dependencies is still a good to have cleanup.

mimaison avatar Feb 02 '24 13:02 mimaison

Remove log4j-appender dependency from tools, trogdor and shell

After addressing that, the distribution does not include log4j-appender jar anymore.

chia7712@ubuntu00:~/project/kafka/core/build/distributions$ ls kafka_2.13-3.9.0-SNAPSHOT/libs | grep kafka
kafka_2.13-3.9.0-SNAPSHOT.jar
kafka-clients-3.9.0-SNAPSHOT.jar
kafka-group-coordinator-3.9.0-SNAPSHOT.jar
kafka-group-coordinator-api-3.9.0-SNAPSHOT.jar
kafka-metadata-3.9.0-SNAPSHOT.jar
kafka-raft-3.9.0-SNAPSHOT.jar
kafka-server-3.9.0-SNAPSHOT.jar
kafka-server-common-3.9.0-SNAPSHOT.jar
kafka-shell-3.9.0-SNAPSHOT.jar
kafka-storage-3.9.0-SNAPSHOT.jar
kafka-storage-api-3.9.0-SNAPSHOT.jar
kafka-streams-3.9.0-SNAPSHOT.jar
kafka-streams-examples-3.9.0-SNAPSHOT.jar
kafka-streams-scala_2.13-3.9.0-SNAPSHOT.jar
kafka-streams-test-utils-3.9.0-SNAPSHOT.jar
kafka-tools-3.9.0-SNAPSHOT.jar
kafka-tools-api-3.9.0-SNAPSHOT.jar
kafka-transaction-coordinator-3.9.0-SNAPSHOT.jar
  1. not sure whether it is expected? KafkaLog4jAppender is deprecated now, but we should keep it in release?
  2. For another, the system test kafka_log4j_appender.py gets failed due to same reason.

Hence, we have following approaches to fix above issues.

  1. add log4j-appender dependency to core module. this can fix issue_1 and issue_2
  2. add log4j-appender dependency to copyDependantTestLibs, and then make kafka_log4j_appender.py expose new classpath to include to log4j-appender jar. this can fix issue_2.

@ijuma WDYT? I prefer approach_1 as it keep the compatibility.

chia7712 avatar Jul 08 '24 16:07 chia7712