Skip to content

Commit

Permalink
feat: 로그에 token 값도 출력하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed May 29, 2024
1 parent 0101ba0 commit ea09889
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
import org.springframework.web.filter.OncePerRequestFilter;

import java.io.IOException;
Expand All @@ -17,7 +18,12 @@ private static void logRequest(HttpServletRequest request) {
return;
}
String queryString = request.getQueryString();
log.info("Request : {} uri=[{}] content-type=[{}]", request.getMethod(), queryString == null ? request.getRequestURI() : request.getRequestURI() + queryString, request.getContentType());
String bearerToken = request.getHeader(HttpHeaders.AUTHORIZATION);
log.info("Request : {} uri=[{}] content-type=[{}] token=[{}]",
request.getMethod(),
queryString == null ? request.getRequestURI() : request.getRequestURI() + queryString,
request.getContentType(),
bearerToken);
}

@Override
Expand Down

0 comments on commit ea09889

Please sign in to comment.