SpringBoot + Gradleプロジェクトでlog4j
を有効にしようとするのは、Mavenよりも一般的ではありません。SpringBoot Gradleでlog4jを有効にする方法:log4j-over-slf4j.jar、slf4j-log4j12.jar複数のバインド
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
質問
のGradleを使用してそれを解決する方法- :だから、ここで私が直面してる問題ですか?
- http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html#howto-configure-log4j-for-loggingに記載されているLog4j2の代わりにLog4j 1.xを使用するには?
- 既存のlog4j.xmlをそのままSpringBootに再利用するにはどうすればいいですか?