Der Versuch, log4j
in SpringBoot + Gradle-Projekt zu aktivieren ist weniger üblich als Maven. So, hier ist das Problem, das ich bin vor:So aktivieren Sie Log4j auf SpringBoot Gradle: log4j-über-slf4j.jar, slf4j-log4j12.jar Mehrere Bindungen
gradle clean bootRun --stacktrace
:clean
:compileJava
:processResources
:classes
:findMainClass
:bootRun
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/mdesales/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mdesales/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" java.lang.ExceptionInInitializerError
Fragen
- Wie es lösen Gradle mit?
- Wie wird Log4j 1.x anstelle von Log4j2 wie unter http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html#howto-configure-log4j-for-logging dokumentiert verwendet?
- Wie wird eine vorhandene log4j.xml ohne Änderungen in SpringBoot wieder verwendet?