This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 65290dc09ea Make jul-to-slf4j work in ShardingSphere-Proxy only 
(#32347)
65290dc09ea is described below

commit 65290dc09eaeda1358146af24aff60cbd9feb70b
Author: 吴伟杰 <[email protected]>
AuthorDate: Thu Aug 1 00:58:36 2024 +0800

    Make jul-to-slf4j work in ShardingSphere-Proxy only (#32347)
---
 .../apache/shardingsphere/infra/util/eventbus/EventBusContext.java  | 6 ------
 pom.xml                                                             | 4 ----
 proxy/bootstrap/pom.xml                                             | 4 ++++
 .../src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java    | 6 ++++++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
index c33f5b78121..4a377b164d5 100644
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.infra.util.eventbus;
 
 import com.google.common.eventbus.EventBus;
-import org.slf4j.bridge.SLF4JBridgeHandler;
 
 /**
  * Event bus context.
@@ -27,11 +26,6 @@ public final class EventBusContext {
     
     private final EventBus eventBus = new EventBus();
     
-    static {
-        SLF4JBridgeHandler.removeHandlersForRootLogger();
-        SLF4JBridgeHandler.install();
-    }
-    
     /**
      * Register event subscriber.
      *
diff --git a/pom.xml b/pom.xml
index 75fe2e0e34a..c0f9abc15bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -987,10 +987,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jul-to-slf4j</artifactId>
-        </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
diff --git a/proxy/bootstrap/pom.xml b/proxy/bootstrap/pom.xml
index d543b5a5a8c..a5c909ca514 100644
--- a/proxy/bootstrap/pom.xml
+++ b/proxy/bootstrap/pom.xml
@@ -143,6 +143,10 @@
             <artifactId>logback-classic</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git 
a/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java 
b/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java
index ca206a36203..c0de3996422 100644
--- 
a/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java
+++ 
b/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java
@@ -28,6 +28,7 @@ import org.apache.shardingsphere.proxy.frontend.CDCServer;
 import org.apache.shardingsphere.proxy.frontend.ShardingSphereProxy;
 import org.apache.shardingsphere.proxy.frontend.ssl.ProxySSLContext;
 import org.apache.shardingsphere.proxy.initializer.BootstrapInitializer;
+import org.slf4j.bridge.SLF4JBridgeHandler;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -42,6 +43,11 @@ import java.util.Optional;
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class Bootstrap {
     
+    static {
+        SLF4JBridgeHandler.removeHandlersForRootLogger();
+        SLF4JBridgeHandler.install();
+    }
+    
     /**
      * Main entrance.
      *

Reply via email to