본문으로 건너뛰기

SpringBoot 사용하여 Request요청을 로깅하기

Request 요청 로깅을 할 경우, 모든 REST API 컨트롤러에 로그를 남기는것도 하나의 방법이다. 하지만 모든 API 컨트롤러에 로깅을 작성하게 된다면 비효율적으로 작업이 될 수 있다.

When logging requests, one approach is to add logging to every REST API controller. However, writing logging code in every API controller can be inefficient.

Spring Interceptor 라는 것을 사용해서, 컨트롤러의 Handler로 도착하기 전에 가로채어 따로 작업을 해 주는 방법을 정리하려고 한다

I will explain how to use Spring Interceptor to intercept requests before they reach the controller's Handler and perform separate processing.