본문 바로가기
Java & Spring

SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation.

by 모닝위즈 2023. 10. 31.
반응형

build.gradle 파일에서 ...

 

dependencies {
    // Spring MVC Dependency
    implementation "org.springframework:spring-core:5.0.0.RELEASE"
    implementation "org.springframework:spring-beans:5.0.0.RELEASE"
    implementation "org.springframework:spring-context:5.0.0.RELEASE"
    implementation "org.springframework:spring-webmvc:5.0.0.RELEASE"
    implementation "org.springframework:spring-websocket:4.1.6.RELEASE"
    implementation "org.springframework:spring-messaging:5.0.0.RELEASE"

    .... 중략

    // Log4j
    // SLF4J와 Log4j 2 연동 브릿지 추가
    implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.10.0'
    // Log4jdbc-Remix 라이브러리 추가
    implementation "org.lazyluke:log4jdbc-remix:0.2.7"
    testImplementation 'org.slf4j:slf4j-simple:1.7.25'
    // SLF4J 라이브러리 추가
    implementation 'org.slf4j:slf4j-api:1.7.25'
    implementation "log4j:log4j:1.2.17"


    // TIKA
    implementation 'org.apache.tika:tika-core:2.6.0'
    
    
    .... 중략
    
}

 

위와 같이 구성을 하였으나...

java config를 통하여 MybatisConfig를 구성하고, Log4jdbcProxyDataSource를 설정하였고,

log4j2.xml도 올바르게 구성하였고, 지정된 위치에 자리하였다..

 

근데 왜 안되나...

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/C:/java_workspace/testProj/build/libs/exploded/testProj-1.0-SNAPSHOT.war/WEB-INF/lib/log4j-slf4j-impl-2.12.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.

 

//implementation 'org.apache.tika:tika-core:2.6.0'
implementation 'org.apache.tika:tika-core:2.4.1'

tika의 버전을 다운그레이드하니 log4j가 잘 작동한다....

 

ps. 아니 근데 maven에서는 잘 되었는데 -_- 

 

 

 

 

참고 자료: https://forum.jmix.io/t/no-slf4j-providers-were-found/2259

 

댓글