Skip to content

Commit

Permalink
Make jul-to-slf4j work in ShardingSphere-Proxy only (#32347)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeslaCN authored Jul 31, 2024
1 parent a002c58 commit 65290dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,11 +26,6 @@ public final class EventBusContext {

private final EventBus eventBus = new EventBus();

static {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
}

/**
* Register event subscriber.
*
Expand Down
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions proxy/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand All @@ -42,6 +43,11 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Bootstrap {

static {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
}

/**
* Main entrance.
*
Expand Down

0 comments on commit 65290dc

Please sign in to comment.