summaryrefslogtreecommitdiffstats
path: root/zookeeper-command-line-client
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-12-20 15:41:30 +0100
committerGitHub <noreply@github.com>2021-12-20 15:41:30 +0100
commitac8c1d6b5b1571674d5377a91c0503fc381d67b8 (patch)
treef2f89e8c714c429caa2f3d20ff2efa5fdbcaa179 /zookeeper-command-line-client
parent679e198009524e2040322d7f40ed70893586b27f (diff)
parentc6d94093df804fefa0c92affe81dea4cbfc91625 (diff)
Merge pull request #20594 from vespa-engine/exclude-log4j
Use slf4j SimpleLogger instead of log4j
Diffstat (limited to 'zookeeper-command-line-client')
-rw-r--r--zookeeper-command-line-client/pom.xml24
-rw-r--r--zookeeper-command-line-client/src/main/java/com/yahoo/vespa/zookeeper/cli/Main.java6
2 files changed, 30 insertions, 0 deletions
diff --git a/zookeeper-command-line-client/pom.xml b/zookeeper-command-line-client/pom.xml
index f1fc49dcb1c..a8105c78881 100644
--- a/zookeeper-command-line-client/pom.xml
+++ b/zookeeper-command-line-client/pom.xml
@@ -15,6 +15,17 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <!-- This is the log4j 1.2 binding for slf4j. Must not be used with log4j-over-slf4j (see below) -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.yahoo.vespa</groupId>
@@ -38,6 +49,19 @@
<artifactId>slf4j-api</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <!-- Bind to slf4j's SimpleLogger -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <!-- slf4j's replacement for log4j. See http://www.slf4j.org/legacy.html#log4j-over-slf4j -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
</dependencies>
<build>
<plugins>
diff --git a/zookeeper-command-line-client/src/main/java/com/yahoo/vespa/zookeeper/cli/Main.java b/zookeeper-command-line-client/src/main/java/com/yahoo/vespa/zookeeper/cli/Main.java
index 3c89e5105ca..7f7965f82eb 100644
--- a/zookeeper-command-line-client/src/main/java/com/yahoo/vespa/zookeeper/cli/Main.java
+++ b/zookeeper-command-line-client/src/main/java/com/yahoo/vespa/zookeeper/cli/Main.java
@@ -3,6 +3,7 @@ package com.yahoo.vespa.zookeeper.cli;
import com.yahoo.vespa.zookeeper.client.ZkClientConfigBuilder;
import org.apache.zookeeper.ZooKeeperMain;
+import org.slf4j.impl.SimpleLogger;
import java.io.IOException;
@@ -10,6 +11,11 @@ import java.io.IOException;
* @author bjorncs
*/
public class Main {
+
+ static {
+ System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "WARN");
+ }
+
public static void main(String[] args) throws IOException, InterruptedException {
new ZkClientConfigBuilder()
.toConfigProperties()