diff --git a/crd-generator/cli/pom.xml b/crd-generator/cli/pom.xml
index f9dae1244eb..93e6c59b429 100644
--- a/crd-generator/cli/pom.xml
+++ b/crd-generator/cli/pom.xml
@@ -45,8 +45,16 @@
- ch.qos.logback
- logback-classic
+ org.apache.logging.log4j
+ log4j-slf4j2-impl
+
+ compile
+
+
+ org.apache.logging.log4j
+ log4j-core
+
+ compile
diff --git a/crd-generator/cli/src/main/java/io/fabric8/crd/generator/cli/LoggingConfiguration.java b/crd-generator/cli/src/main/java/io/fabric8/crd/generator/cli/LoggingConfiguration.java
index b0d55ccd9a1..ef8e6156795 100644
--- a/crd-generator/cli/src/main/java/io/fabric8/crd/generator/cli/LoggingConfiguration.java
+++ b/crd-generator/cli/src/main/java/io/fabric8/crd/generator/cli/LoggingConfiguration.java
@@ -15,9 +15,8 @@
*/
package io.fabric8.crd.generator.cli;
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.config.Configurator;
import java.util.List;
@@ -34,15 +33,13 @@ static void configureLogger(List verbose) {
}
private static void configureLogger(LogLevel baseLogLevel) {
- setLogLevel("io.fabric8.crd.generator.cli", baseLogLevel.toLogbackLevel());
- setLogLevel("io.fabric8.crd.generator.collector", baseLogLevel.toLogbackLevel());
- setLogLevel("io.fabric8.crdv2.generator", baseLogLevel.toLogbackLevel());
+ setLogLevel("io.fabric8.crd.generator.cli", baseLogLevel.toLog4jLevel());
+ setLogLevel("io.fabric8.crd.generator.collector", baseLogLevel.toLog4jLevel());
+ setLogLevel("io.fabric8.crdv2.generator", baseLogLevel.toLog4jLevel());
}
private static void setLogLevel(String packageName, Level level) {
- LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
- ch.qos.logback.classic.Logger logger = loggerContext.getLogger(packageName);
- logger.setLevel(level);
+ Configurator.setLevel(packageName, level);
}
/**
@@ -71,8 +68,8 @@ enum LogLevel {
DEBUG,
TRACE;
- Level toLogbackLevel() {
- return Level.toLevel(name());
+ Level toLog4jLevel() {
+ return Level.valueOf(name());
}
}
}
diff --git a/pom.xml b/pom.xml
index 8cceba67d65..4c3096253fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -124,7 +124,6 @@
${jackson.version}
2.0.16
2.24.1
- 1.3.14
1.18.34
2.8
2.2
@@ -861,11 +860,6 @@
${log4j.version}
test
-
- ch.qos.logback
- logback-classic
- ${logback.version}
-
io.vertx
vertx-core