개발새발

[Spring] Log4j 본문

Framework/Spring

[Spring] Log4j

재래김유진 2019. 12. 16. 21:46
728x90
반응형

Test할땐 잘 되던 @Log4j 가 BoardServiceImpl에서 사용하려니 먹질 않았다. 

1
2
3
4
5
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-1.2-api</artifactId>
            <version>2.7</version>
        </dependency>
 
 

pom.xml에 요 dependency 추가 

 

[참고 블로그]

https://tjsdudkim.tistory.com

 

스프링MVC의 Controller6-1

스프링MVC를 이용하는 경우 작성되는 Controller는 다음과 같은 특징이 있음. -HttpServletRequest,HttpServletResponse를 거의 사용할 필요가 없이 필요한 기능 구현 -다양한 타입의 파라미터 처리,다양한 타입..

tjsdudkim.tistory.com

 


 

[위에꺼 아님! 저렇게 dependency 추가해줘도 이상한 에러뜸]

 

"org.apache.log4j.logger cannot be resolved to a type" 에러는

 

pom.xml 에 dependency 추가한 버전에 맞게 log4j.jar 추가해줌

[프로젝트 우클릭] - [properties] - [java build path]

 

[log4j.jar 받기]

http://logging.apache.org

 

Apache log4j 1.2 - Download Apache log4j 1.2

Log4j 2 is nominated for the JAX Innovation Awards! Do you like its performance, garbage-free logging, and easy and flexible configuration? Log4j 2 needs your love. Vote for Log4j 2! End of Life On August 5, 2015 the Logging Services Project Management Com

logging.apache.org

 

728x90
반응형
Comments