Skip to content

Conversation

heedaeshin
Copy link
Contributor

@heedaeshin heedaeshin commented Sep 20, 2024

  • TracingMiddleware에서 zerolog를 사용하여 API 요청 및 응답을 로깅하도록 개선하
  • 응답의 상태 코드에 따라 로그 레벨을 동적으로 설정하도록 수정
    • 2XX, 3XX 상태 코드: Info 레벨로 로깅
    • 4XX 상태 코드: Warn 레벨로 로깅
    • 5XX 상태 코드: Error 레벨로 로깅
  • c.Response().After 함수를 next(c) 호출 이전에 등록, 응답 후에 정확한 로그가 출력 되도록 수정
  • 로그 메시지에 요청 및 응답의 상세 정보를 포함
    • Method, URI, Status, Latency, BytesIn, BytesOut 등
  • traceId와 spanId를 컨텍스트에 저장하고, 로거에 포함하여 요청의 추적 확인 완료

@heedaeshin heedaeshin merged commit 0ad61a8 into main Sep 20, 2024
2 checks passed
@heedaeshin heedaeshin deleted the feature/update-api-trace branch September 20, 2024 07:00
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.

1 participant