Uh oh!
There was an error while loading. Please reload this page.
feat: 요청 추적용 MDC traceId/userId 로깅 main에 포팅 - #239
Conversation
dev에서 검증된 MdcLoggingFilter(요청마다 8자리 traceId 발급)와 logback-spring.xml(콘솔+롤링파일 appender, 로그 패턴에 traceId 포함)을 main에 반영한다. ELK 연동 없이 순수 Logback 설정이라 prod에 넣어도 안전하다. MdcLoggingFilter는 JWT 헤더에서 best-effort로 userId도 채우는데, @userid 파라미터로 실제 인증 검증을 거친 요청은 UserIdResolver가 더 정확한 값으로 덮어써야 해서 그쪽에도 MDC.put을 같이 추가했다 (dev에서 이미 이렇게 짝을 이루던 설계).
Warning Review limit reached
Next review available in:6 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
logback-spring.xml이 main에 추가되면서 src/main/resources 디렉터리가 이미 git에 존재하게 됐다. 기존 mkdir(비-p)은 디렉터리가 이미 있으면 실패해서 CI/CD가 깨졌다 (mkdir: cannot create directory: File exists).
Uh oh!
There was an error while loading. Please reload this page.
작업 배경
dev에서 검증됐던 요청 추적 로깅(MdcLoggingFilter + logback-spring.xml)이 트렁크 기반 전환 콘텐츠 정합화 때 "로컬 모니터링 스택 전용"으로 오판되어 main에 없었다. 실제로는 ELK 연동 없이도 독립적으로 동작하는(콘솔+파일 appender만 사용) 순수 로깅 기능이라 포팅한다.
변경 사항
config/logging/MdcLoggingFilter.java(신규)finally에서 반드시 MDC.remove (톰캣 스레드 재사용 시 이전 요청 값 누수 방지)resources/logback-spring.xml(신규)%X{traceId}포함, Console + RollingFile(30일 보관, gzip 압축) appendercommon/resolver/userId/UserIdResolver.javaMDC.put추가common/resolver/userId/UserIdResolverTest.java@AfterEach MDC.clear()영향 범위
./logs디렉터리에 롤링 로그 파일이 쌓이기 시작함 (30일 보관 후 자동 삭제)Test Plan
./gradlew test전체 254/254 통과[traceId] [userId=]패턴이 실제로 찍히는 것 확인🤖 Generated with Claude Code