[KYUUBI #3037] Handles configuring the JUL -> SLF4J bridge
### _Why are the changes needed?_ Handles configuring the JUL -> SLF4J bridge, otherwise, the components which use JUL like Jersey will be not controlled by log4j2 configurations ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3037 from pan3793/jul. Closes #3037 fda05ff6 [Cheng Pan] update license 31f579fd [Cheng Pan] nit 7da0f9fb [Cheng Pan] Fix dependencyList 3179e6bd [Cheng Pan] Handles configuring the JUL -> SLF4J bridge Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
parent
d3446675ac
commit
c5d29260a3
@ -327,6 +327,7 @@ com.github.scopt:scopt_*
|
||||
io.github.classgraph:classgraph
|
||||
org.slf4j:slf4j-api
|
||||
org.slf4j:jcl-over-slf4j
|
||||
org.slf4j:jul-over-slf4j
|
||||
|
||||
kyuubi-server/src/main/resources/org/apache/kyuubi/ui/static/assets/fonts/*
|
||||
kyuubi-server/src/main/resources/org/apache/kyuubi/ui/static/icon.min.css
|
||||
|
||||
@ -80,6 +80,7 @@ jetty-servlet/9.4.48.v20220622//jetty-servlet-9.4.48.v20220622.jar
|
||||
jetty-util-ajax/9.4.48.v20220622//jetty-util-ajax-9.4.48.v20220622.jar
|
||||
jetty-util/9.4.48.v20220622//jetty-util-9.4.48.v20220622.jar
|
||||
jline/0.9.94//jline-0.9.94.jar
|
||||
jul-to-slf4j/1.7.35//jul-to-slf4j-1.7.35.jar
|
||||
kubernetes-client/5.12.1//kubernetes-client-5.12.1.jar
|
||||
kubernetes-model-admissionregistration/5.12.1//kubernetes-model-admissionregistration-5.12.1.jar
|
||||
kubernetes-model-apiextensions/5.12.1//kubernetes-model-apiextensions-5.12.1.jar
|
||||
|
||||
@ -252,12 +252,6 @@
|
||||
<!-- for hive related test only -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
|
||||
7
externals/kyuubi-flink-sql-engine/pom.xml
vendored
7
externals/kyuubi-flink-sql-engine/pom.xml
vendored
@ -128,13 +128,6 @@
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.flink</groupId>
|
||||
<artifactId>flink-test-utils${flink.module.scala.suffix}</artifactId>
|
||||
|
||||
6
externals/kyuubi-hive-sql-engine/pom.xml
vendored
6
externals/kyuubi-hive-sql-engine/pom.xml
vendored
@ -165,12 +165,6 @@
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
6
externals/kyuubi-jdbc-engine/pom.xml
vendored
6
externals/kyuubi-jdbc-engine/pom.xml
vendored
@ -59,12 +59,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.dimafeng</groupId>
|
||||
<artifactId>testcontainers-scala-scalatest_${scala.binary.version}</artifactId>
|
||||
|
||||
6
externals/kyuubi-spark-sql-engine/pom.xml
vendored
6
externals/kyuubi-spark-sql-engine/pom.xml
vendored
@ -125,12 +125,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.iceberg</groupId>
|
||||
<artifactId>${iceberg.name}</artifactId>
|
||||
|
||||
6
externals/kyuubi-trino-engine/pom.xml
vendored
6
externals/kyuubi-trino-engine/pom.xml
vendored
@ -71,12 +71,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.dimafeng</groupId>
|
||||
<artifactId>testcontainers-scala-scalatest_${scala.binary.version}</artifactId>
|
||||
|
||||
@ -81,12 +81,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -62,12 +62,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- hive -->
|
||||
<dependency>
|
||||
<groupId>org.apache.kyuubi</groupId>
|
||||
|
||||
@ -62,12 +62,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
|
||||
@ -62,12 +62,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- trino -->
|
||||
<dependency>
|
||||
<groupId>org.apache.kyuubi</groupId>
|
||||
|
||||
@ -48,6 +48,11 @@
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
@ -121,12 +126,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.scala-lang</groupId>
|
||||
<artifactId>scala-compiler</artifactId>
|
||||
|
||||
@ -21,6 +21,7 @@ import org.apache.logging.log4j.{Level, LogManager}
|
||||
import org.apache.logging.log4j.core.{Logger => Log4jLogger, LoggerContext}
|
||||
import org.apache.logging.log4j.core.config.DefaultConfiguration
|
||||
import org.slf4j.{Logger, LoggerFactory}
|
||||
import org.slf4j.bridge.SLF4JBridgeHandler
|
||||
import org.slf4j.impl.StaticLoggerBinder
|
||||
|
||||
/**
|
||||
@ -92,6 +93,10 @@ trait Logging {
|
||||
}
|
||||
|
||||
private def initializeLogging(isInterpreter: Boolean): Unit = {
|
||||
// Handles configuring the JUL -> SLF4J bridge
|
||||
SLF4JBridgeHandler.removeHandlersForRootLogger()
|
||||
SLF4JBridgeHandler.install()
|
||||
|
||||
if (Logging.isLog4j2) {
|
||||
// scalastyle:off println
|
||||
if (Logging.isLog4j2DefaultConfigured()) {
|
||||
|
||||
@ -101,12 +101,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.hadoop</groupId>
|
||||
<artifactId>hadoop-minikdc</artifactId>
|
||||
|
||||
@ -45,12 +45,6 @@
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -79,12 +79,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.kyuubi</groupId>
|
||||
<artifactId>kyuubi-zookeeper_${scala.binary.version}</artifactId>
|
||||
|
||||
@ -96,12 +96,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
|
||||
@ -366,12 +366,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.unboundid</groupId>
|
||||
<artifactId>unboundid-ldapsdk</artifactId>
|
||||
|
||||
@ -51,12 +51,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-framework</artifactId>
|
||||
|
||||
@ -45,12 +45,6 @@
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user