-
Notifications
You must be signed in to change notification settings - Fork 0
[REFACTOR] RestClient 로깅 분리 #17
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||
| package com.samhap.kokomen.global.aop; | ||||||
|
|
||||||
| import lombok.extern.slf4j.Slf4j; | ||||||
| import org.aspectj.lang.ProceedingJoinPoint; | ||||||
| import org.aspectj.lang.annotation.Around; | ||||||
| import org.aspectj.lang.annotation.Aspect; | ||||||
| import org.springframework.core.annotation.Order; | ||||||
| import org.springframework.stereotype.Component; | ||||||
| import org.springframework.util.StopWatch; | ||||||
|
|
||||||
| @Slf4j | ||||||
| @Order(1) | ||||||
| @Aspect | ||||||
| @Component | ||||||
| public class TosspaymentsLoggingAspect { | ||||||
|
|
||||||
| @Around("execution(* com.samhap.kokomen.payment.external.TosspaymentsClient.*(..))") | ||||||
| public Object logTosspaymentsApiCall(ProceedingJoinPoint joinPoint) throws Throwable { | ||||||
| String methodName = joinPoint.getSignature().getName(); | ||||||
| Object[] args = joinPoint.getArgs(); | ||||||
|
|
||||||
| log.info("[토스페이먼츠 API 요청] {} - args: {}", methodName, args); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logging statement includes the full request arguments (
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 결제 요청 인자(args)를 그대로 로깅하면 민감한 결제 정보가 노출될 수 있습니다.
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| StopWatch stopWatch = new StopWatch(); | ||||||
| stopWatch.start(); | ||||||
| Object result = joinPoint.proceed(); | ||||||
| stopWatch.stop(); | ||||||
| log.info("[토스페이먼츠 API 응답] {} - {}ms - response: {}", | ||||||
| methodName, stopWatch.getTotalTimeMillis(), result); | ||||||
| return result; | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
어노테이션 순서: Spring 어노테이션을 Lombok 어노테이션보다 앞에 배치해주세요.
코딩 가이드라인에 따르면 Spring 어노테이션이 Lombok 어노테이션보다 먼저 위치해야 합니다.
♻️ 수정 제안
As per coding guidelines, "Use Lombok for constructors, getters/setters with Spring annotations before Lombok annotations".
📝 Committable suggestion
🤖 Prompt for AI Agents