Skip to content

[BE] 외부 API timeout 명시 및 구조화 로그 보완 #290

@duku0751

Description

@duku0751

목적

외부 API 호출 시 timeout 누락으로 인한 스레드 무한 대기 방지, 그리고 운영 환경에서 Cloud Logging 기반 필드 검색이 가능하도록 구조화 로그를 보완합니다.


작업 내용

timeout 추가

  • SsoService — Google/Kakao/Naver 토큰 교환 및 유저정보 조회 4곳 10s
  • PaymentService — PortOne 결제 조회 15s

구조화 로그 보완

  • logback-spring.xml — prod JSON 인코더 적용, default 프로필 fallback 추가, springProfile AND 조건 수정
  • MdcLoggingFilter — 요청 완료 시 access log 추가 (httpStatus, durationMs MDC 필드화)
  • GlobalExceptionHandler — 모든 핸들러에 errorCode MDC 통일 (기존 CustomException에만 적용되던 것을 전체 핸들러로 확대)
  • JwtAuthenticationFilter — 조기 리턴 경로에서 userId MDC 누락 제거
  • application.yml — logback-spring.xml과 중복되는 dead config(logging.pattern.console) 제거

영향 범위

  • global/filter — MdcLoggingFilter, JwtAuthenticationFilter
  • global/exception — GlobalExceptionHandler
  • auth/service — SsoService
  • payment/service — PaymentService
  • resources — logback-spring.xml, application.yml

완료 조건

  • 기능 정상 동작
  • Lint / 타입 체크 통과
  • API 명세 업데이트

관련 이슈 / 참고

Metadata

Metadata

Assignees

Labels

choreMaintenance tasks, cleanup, and non-functional changes

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions