Programming/Spring

[Spring] LoggerFactory is not a Logback LoggerContext but Logback is on the classpath 에러

OriginMaster 2021. 11. 8. 14:55
반응형

Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/users/apache-tomcat-8.5.72/webapps/Board-0.0.1-SNAPSHOT/WEB-INF/lib/slf4j-log4j12-1.7.5.jar)

 

SpringBoot의 경우 내부에 이미 logback에 대한 의존성이 있기 때문에 생기는 충돌

 


  • 해결

 

slf4j-log4j12-1.7.5 에 대한 의존성을 제외 후 war/jar 파일 만들어서 재구동.

반응형