apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.53k stars 1.3k forks source link

Fix logging dependencies in pinot-spi #6364

Open kkrugler opened 3 years ago

kkrugler commented 3 years ago

pinot-spi’s pom has a dependency on log4j-slf4j-impl. I don’t think this is right - it should only depend on slf4j-api. Because of the current dependency, the pinot-java-client’s dependency on pinot-spi pulls in the logging implementation, which is not what you want because it means an external project using the client often needs to exclude those logging jars.

I'm guessing there are other components with a similar issue - only jars that are run from the command line should have dependencies on log4j-slf4j-impl, and include log4j2 configuration resources.

kkrugler commented 3 years ago

In addition to pinot-spi, there's also pinot-common that has a non-test dependency on log4j.

kkrugler commented 3 years ago

And the following components (maybe others?) would need to add non-test dependencies on log4j-slf4j-impl:

kkrugler commented 3 years ago

You could also remove a number of log4j entries from the dependency management section of the top-level pom.xml, as once you have a dependency on log4j-slf4j-impl, that pulls in log4j-core and log4j-api, etc.