개발 도중 Slf4j 로깅을 적용하는 도중 에러가 발생하였다.
캡쳐한 부분의 로그를 보면 아래와 같다.
ERROR LOG
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.helpers.NOPLoggerFactory loaded from file:/Users/mk1/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.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 implementation 부분을 제거하면 해결이 된다.
만약 해당 라이브러리를 꼭 써야한다면 아래와 같이 예외처리를 하면 된다고 한다.
직접 이러한 경우를 경험하진 않아 어떤 경우에 써야하는지는 추후 더 알아볼 생각이다.
configurations {
compile.exclude group: "org.slf4j", module: "slf4j-log4j12"
}
참고
LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementat
springboot 실행시 아래와 같은 에러 발생 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.Log4jLoggerFac
cpdev.tistory.com
728x90
'DEV > ErorrBox' 카테고리의 다른 글
[Error] @SpringBootTest is not import (0) | 2023.12.07 |
---|---|
[Error] Spring Security 6.1.x .requestMatchers() cannot decide whether these patterns (1) | 2023.08.02 |
[Error] org.openqa.selenium.ElementNotInteractableException: element not interactable (1) | 2023.05.28 |
[Error] @EqualsAndHashCode(callSuper=false) (0) | 2023.05.07 |
[Error] Package 'python' has no installation candidate (1) | 2023.03.24 |