티스토리 뷰

Programming/JAVA

Log4j2 SLF4J Binding 설정

불량시계 2023. 2. 12. 16:15

Slf4j에 Log4j2가 제대로 Binding 되지 않아 고생하다 해결책을 찾고 너무 쉬워서 허무했다.

나랑 비슷한 상황을 격는 사람도 있을 것 같고, 또 잊어버릴 것 같아 적어둔다.

 

해결책 : Log4j 버전에 맞는 Slf4j 버전을 사용한다.

링크 : https://logging.apache.org/log4j/2.x/log4j-slf4j-impl.html

 

Log4j – Log4j 2 SLF4J Binding

<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apa

logging.apache.org

아파치 Log4j 홈페이지에 가보면 떡하니 바로 나와있다.

1. SLF4j 버전이 1.7.x 이거나 그 이전이면 : log4j-slf4j-impl

2. SLF4j 버전이 2.x이거나 그 이후이면 : log4j-slf4j2-impl

 

자세한 사항은 위 링크를 참고하면 된다.

댓글