반응형
프로젝트 구조
- Java 21
- gradle
- Spring boot 3.X
- Spring Webflux
- kotlin
에러 발생
- java, spring boot, gradle 등 프로젝트 주요 라이브러리의 버전업 후, 프로젝트 boot시에 에러가 발생하는 것을 발견
SLF4J(W): No SLF4J providers were found. SLF4J(W): Defaulting to no-operation (NOP) logger implementation SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details. SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier. SLF4J(W): Ignoring binding found at [jar:file:/Users/kidd.curious/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.9/7d495522b08a9a66084bf417e70eedf95ef706bc/logback-classic-1.2.9.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J(W): See https://www.slf4j.org/codes.html#ignoredBindings for an explanation. Exception in thread "main" 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.helpers.NOPLoggerFactory loaded from file:/Users/kidd.curious/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.11/ad96c3f8cf895e696dd35c2bc8e8ebe710be9e6d/slf4j-api-2.0.11.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.helpers.NOPLoggerFactory
- 기존엔 정상 작동 하던 코드여서.. 더욱 막막했습니다.
원인
- 라이브러리가 최신화되면서 구현 구조가 변경되었고, 이것이 이번 오류의 문제점인것을 알 수 있었습니다.
- 이미 SLF4J에서 많은 오류와 해결 방법을 정리해놓았고, 저에게 발생한 문제도 확인 할 수 있었습니다.
- SLF4J에서 오류 확인 가능
해결 방법
- 저의 오류의 경우 여러가지 해결책이 제시되어있지만 저는 sl4j-simple를 추가하기로 결정하였습니다.
- 가장 대중적이면서, 사람들에게 널리 사용되고 있는 방법이기에 채택하였습니다
implementation("org.slf4j:slf4j-simple")
반응형