fix: 파일 로그를 JSON 포맷으로 변경하여 스택트레이스 분리 수집 문제 해결 - #482
Merged
Merged
Conversation
📊 테스트 커버리지 리포트
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
reqId로 검색하면 에러 로그의 첫 줄만 나오고 스택트레이스가 빠졌습니다. 평문 로그의 스택트레이스(at ...) 줄이 Alloy에서 한 줄씩 별도 로그로 수집되면서,reqId도 레벨도 없는 조각으로 흩어졌기 때문입니다./var/log/eatssu/app.log)만 JSON 포맷으로 바꿔서, 로그 한 건과 스택트레이스가 JSON 한 줄로 기록되도록 했습니다.build.gradle:logstash-logback-encoder:7.4를 추가했습니다. Spring Boot 3.0.4에 포함된 Logback 1.4.5와 호환되는 7.x 버전입니다.logback-spring.xml: FILE appender의 encoder를LogstashEncoder로 바꾸고, 타임스탬프를Asia/Seoul로 지정했습니다. 더 이상 쓰지 않는FILE_LOG_PATTERN은 삭제했습니다.stack_trace,level,requestId(MDC),logger_name,thread_name이 JSON 필드로 분리됩니다.| json | requestId="..."처럼 필드로 검색할 수 있습니다.detected_level이 본문 추정이 아니라level필드 기준으로 정확히 잡힙니다.💬 공유사항 to 리뷰어
|= "reqId=..."문자열 검색은 더 이상 걸리지 않습니다. JSON에서는"requestId":"..."형태로 찍히기 때문입니다.{service_name="eatssu-prod"} | json | requestId="<값>"으로 조회하거나,|= "<값>"처럼 값만 넣어 검색하면 됩니다.stage.json과stage.timestamp를 추가하면 되는데, 이번 PR에는 넣지 않았습니다.requestId·KST 시각이 JSON 한 줄로 찍히는 것을 확인했습니다.GET /error-test를 호출한 뒤{service_name="eatssu-dev"} | json으로 조회해서stack_trace필드가 함께 나오는지 봐 주세요.ddl-auto: create-drop과 Flyway가 충돌하는 문제입니다.✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.
🤖 Generated with Claude Code