Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/275] api 요청 로그 filter 구현 및 로그인 요청 로그 출력 추가 #276

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

Eunjin3395
Copy link
Member

@Eunjin3395 Eunjin3395 commented Oct 9, 2024

🚀 개요

api 요청 로그 filter 구현
로그인 요청 로그 출력 추가

🔍 변경사항

  • api 요청 로그 filter 구현: memberId가 있는 경우, 같이 출력하도록 변경
  • 로그인 요청 로그 출력 추가
  • 컨트롤러 로그에는 메소드와 실행 시간만 출력되도록 변경

⏳ 작업 내용

  • api 요청 로그 filter 구현
  • 로그인 요청 로그 출력 추가
  • LogAspect 수정

📝 논의사항

@Eunjin3395 Eunjin3395 requested review from rimi3226 and hzee97 October 9, 2024 23:41
@Eunjin3395 Eunjin3395 self-assigned this Oct 9, 2024
@Eunjin3395 Eunjin3395 linked an issue Oct 9, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@rimi3226 rimi3226 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 고생 많으셨습니다ㅜㅜ!

} catch (Exception e) {
log.error("LoggerAspect error", e);
// requestId가 없을 경우 기본값 설정
String requestId = (String) MDC.get("requestId");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 혹시 이 requestId는 무엇인가요..? 이 메소드가 무슨 일을 하는지 궁금한데 알려주실 수 있으신가요..?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한번에 여러 요청이 들어오면 로그가 req, res 한 쌍으로 연속해서 출력되지 않고 req req req res res res 이런식으로 출력되는데,, MDC를 사용하면 매 요청별로 고유의 아이디 값을 저장할 수 있다고 하더라구요..! 요청 - 응답 쌍을 더 구분하기 쉽게 하고 싶어서 추가했습니다!

filterChain.doFilter(request, response);

// 응답 정보 추출
// long executionTime = System.currentTimeMillis() - startTime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지우지 않고 주석으로 남겨둔 이유가 궁금합니당..!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 혹시 나중에 시간 정보 출력이 필요할까봐 놔두긴 했는데,, 그냥 지우는게 나을 것 같아요 ! 수정하고 머지하겠습니다!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 아니 수정하고 머지하겠다고 해놓고 바로 머지를 눌러버렸어요....... 다음 pr에서 수정하겠습니다 ㅠㅠ

@Eunjin3395 Eunjin3395 merged commit 15150cc into develop Oct 10, 2024
@Eunjin3395 Eunjin3395 deleted the feat/275 branch October 10, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ [Feat] 로깅 filter 구현
2 participants