Skip to content

[FEAT] 결제 요청 로깅#328

Merged
unifolio0 merged 1 commit intodevelopfrom
feat/#327
Feb 12, 2026
Merged

[FEAT] 결제 요청 로깅#328
unifolio0 merged 1 commit intodevelopfrom
feat/#327

Conversation

@unifolio0
Copy link
Contributor

closed #327

작업 내용

스크린샷

참고 사항

@unifolio0 unifolio0 self-assigned this Feb 12, 2026
@unifolio0 unifolio0 merged commit 28c42f1 into develop Feb 12, 2026
2 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @unifolio0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 결제 API 호출에 대한 가시성을 높이고 안정성을 강화하기 위해 로깅 기능을 개선하고 타임아웃 설정을 조정합니다. 새로운 AOP를 통해 결제 API의 요청과 응답을 추적하고, 기존 클라이언트 코드에 오류 발생 시 더 자세한 정보를 기록하도록 하여 문제 해결 능력을 향상시킵니다. 또한, 결제 서비스와의 통신 안정성을 위해 읽기 타임아웃을 연장했습니다.

Highlights

  • 결제 API 로깅 AOP 추가: 결제 API 호출의 요청 및 응답을 자동으로 로깅하는 PaymentLoggingAspect AOP가 새로 추가되었습니다.
  • 결제 클라이언트 오류 로깅 강화: PaymentClientconfirmPaymentrefundPayment 메서드에서 발생하는 예외에 대해 더 상세한 오류 로깅이 추가되어 문제 진단에 도움이 됩니다.
  • 결제 서비스 읽기 타임아웃 증가: application.yml 파일에서 결제 서비스의 read-timeout 설정이 개발 및 운영 환경 모두에서 3초에서 10초로 연장되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • api/src/main/java/com/samhap/kokomen/global/aop/PaymentLoggingAspect.java
    • 결제 API 호출의 요청 및 응답을 로깅하는 새로운 AOP 클래스가 추가되었습니다.
  • api/src/main/java/com/samhap/kokomen/token/external/PaymentClient.java
    • confirmPaymentrefundPayment 메서드 내 예외 처리 블록에 상세한 오류 로깅이 추가되었습니다.
  • api/src/main/resources/application.yml
    • payment 섹션의 read-timeout 설정이 3초에서 10초로 변경되었습니다.
Activity
  • 관련 이슈 #327이 이 PR을 통해 해결되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


로그 흐름 따라, 결제 요청 응답 보네, 오류는 잡히리.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@unifolio0 unifolio0 deleted the feat/#327 branch February 12, 2026 09:50
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR adds payment request logging, improves error logging for payment API calls, and increases the payment API read timeout from 3 to 10 seconds, enhancing system visibility. However, the current implementation logs entire request/response objects and raw error response bodies, which presents a significant security risk. Sensitive payment data, such as paymentKey and PII, may be exposed in application logs. It is crucial to re-evaluate the logging strategy to prevent sensitive payment information from being exposed. It is recommended to implement masking or to log only specific non-sensitive fields.

log.info("[Payment API 요청] {} - args: {}", methodName, args);

Object result = joinPoint.proceed();
log.info("[Payment API 응답] {} - response: {}", methodName, result);

Choose a reason for hiding this comment

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

critical

result 객체를 직접 로깅하면 거래 ID, 결제 상태 등 결제 API 응답에 포함된 민감한 정보가 로그에 노출될 수 있습니다. 이는 심각한 보안 위험이므로, 응답 객체에서 민감한 필드는 로깅하기 전에 마스킹하거나, 로깅하지 않도록 처리해야 합니다. result 객체의 toString() 메서드가 민감 정보를 포함하지 않도록 구현하거나, 필요한 비민감 정보만 추출하여 로깅하는 것이 좋습니다.

Comment on lines +21 to +24
log.info("[Payment API 요청] {} - args: {}", methodName, args);

Object result = joinPoint.proceed();
log.info("[Payment API 응답] {} - response: {}", methodName, result);

Choose a reason for hiding this comment

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

security-medium medium

The PaymentLoggingAspect logs all arguments (args) and return values (result) for methods in PaymentClient, which handle sensitive payment data like paymentKey. Logging these directly exposes sensitive information, posing a security risk. It is critical to mask sensitive fields, log only specific non-sensitive fields (e.g., orderId), or ensure toString() methods of DTOs exclude sensitive data.

.retrieve()
.body(PaymentResponse.class);
} catch (RestClientResponseException e) {
log.error("[Payment API 오류] confirmPayment - 상태 코드: {}, 응답: {}", e.getStatusCode(), e.getResponseBodyAsString(), e);

Choose a reason for hiding this comment

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

security-medium medium

Logging e.getResponseBodyAsString() when a RestClientResponseException occurs during a payment API call can expose sensitive transaction details or PII from error responses. It is crucial to avoid logging the raw response body. If logging is necessary for debugging, implement a sanitization step to mask sensitive fields or log only general error messages before logging.

.retrieve()
.toBodilessEntity();
} catch (RestClientResponseException e) {
log.error("[Payment API 오류] refundPayment - 상태 코드: {}, 응답: {}", e.getStatusCode(), e.getResponseBodyAsString(), e);

Choose a reason for hiding this comment

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

security-medium medium

Logging e.getResponseBodyAsString() when a RestClientResponseException occurs during a refund API call can expose sensitive transaction details or PII from error responses. It is crucial to avoid logging the raw response body. If logging is necessary for debugging, implement a sanitization step to mask sensitive fields or log only general error messages before logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 결제 요청 로깅

1 participant