feat(report): 리포트 생성 로그 기록 추가#180
Merged
Merged
Conversation
리포트 생성 로그를 조회·저장할 Repository를 추가하고, 생성 시작/성공/실패 상태를 별도 트랜잭션으로 기록하는 Service를 추가함. BusinessException 기반 에러 코드는 로그의 errorCode와 httpStatus로 변환해 저장
AI 예외에 원인 예외와 외부 HTTP 상태 및 외부 에러 코드를 보존하도록 확장함. 리포트 생성 로그에서 raw error_message 컬럼과 저장 로직을 제거해 민감정보 저장 가능성을 줄임.
일일 리포트 LLM 생성 단계에 로그 기록 연결, 입력·응답 문자 수 컬럼 제거로 로그 지표 단순화
WeeklyReportGenerationListener와 MonthlyReportGenerationListener의 LLM 생성 및 confirm 단계에 report_generation_logs 기록 추가, MonthlyReportGenerationListenerV2의 텍스트 생성·텍스트 confirm·이미지 생성·최종 confirm 단계별 로그 기록 추가
TypeReportGenerationListener의 evidence cards, pattern extraction, type selection, content generation, confirm 단계에 ReportGenerationLogRecorder 기록 추가
LlmExceptionMapper 추가로 WebClientResponseException, HttpStatusCodeException, RestClientResponseException의 HTTP status를 AiServiceUnavailableException에 보존하도록 처리, 리포트 LLM client 호출 실패 시 externalHttpStatus와 externalErrorCode를 report_generation_logs에 전달 가능하도록 정리
ReportGenerationLogRepository 조회 테스트와 ReportGenerationLogService 상태 변경 테스트 추가, AiServiceUnavailableException의 externalHttpStatus와 externalErrorCode 반영 검증 추가
사용하지 않는 report_generation_logs.metadata 컬럼과 ReportGenerationLog metadata 필드 제거, ReportGenerationLogService와 ReportGenerationLogRecorder의 start 시그니처 및 리포트 생성 로그 호출부 정리
report_generation_logs 테이블에서 사용 가능성이 낮은 user_id, status, error_code 기준 인덱스 제거, report_type과 report_id 기준 조회 인덱스만 유지
Collaborator
|
LGTM! |
1Seob
added a commit
that referenced
this pull request
Jun 17, 2026
* feat(report): 리포트 생성 로그 기록 추가 (#180) * feat(report): 리포트 생성 로그 테이블과 엔티티 추가 * feat(report): 리포트 생성 로그 Repository와 Service 추가 리포트 생성 로그를 조회·저장할 Repository를 추가하고, 생성 시작/성공/실패 상태를 별도 트랜잭션으로 기록하는 Service를 추가함. BusinessException 기반 에러 코드는 로그의 errorCode와 httpStatus로 변환해 저장 * feat(report): 리포트 생성 로그에 AI 외부 오류 정보 반영 AI 예외에 원인 예외와 외부 HTTP 상태 및 외부 에러 코드를 보존하도록 확장함. 리포트 생성 로그에서 raw error_message 컬럼과 저장 로직을 제거해 민감정보 저장 가능성을 줄임. * feat(report): 일일 리포트 생성에 로그 기록 연결 일일 리포트 LLM 생성 단계에 로그 기록 연결, 입력·응답 문자 수 컬럼 제거로 로그 지표 단순화 * feat(report): 주간·월간 리포트 생성에 로그 기록 연결 WeeklyReportGenerationListener와 MonthlyReportGenerationListener의 LLM 생성 및 confirm 단계에 report_generation_logs 기록 추가, MonthlyReportGenerationListenerV2의 텍스트 생성·텍스트 confirm·이미지 생성·최종 confirm 단계별 로그 기록 추가 * feat(report): Type 리포트 생성 단계별로 로그 기록 연결 TypeReportGenerationListener의 evidence cards, pattern extraction, type selection, content generation, confirm 단계에 ReportGenerationLogRecorder 기록 추가 * feat(ai): LLM 외부 오류 상태 기록 지원 LlmExceptionMapper 추가로 WebClientResponseException, HttpStatusCodeException, RestClientResponseException의 HTTP status를 AiServiceUnavailableException에 보존하도록 처리, 리포트 LLM client 호출 실패 시 externalHttpStatus와 externalErrorCode를 report_generation_logs에 전달 가능하도록 정리 * test(report): 리포트 생성 로그 테스트 추가 ReportGenerationLogRepository 조회 테스트와 ReportGenerationLogService 상태 변경 테스트 추가, AiServiceUnavailableException의 externalHttpStatus와 externalErrorCode 반영 검증 추가 * refactor(report): 리포트 생성 로그 metadata 제거 사용하지 않는 report_generation_logs.metadata 컬럼과 ReportGenerationLog metadata 필드 제거, ReportGenerationLogService와 ReportGenerationLogRecorder의 start 시그니처 및 리포트 생성 로그 호출부 정리 * refactor(db): 리포트 생성 로그 인덱스 정리 report_generation_logs 테이블에서 사용 가능성이 낮은 user_id, status, error_code 기준 인덱스 제거, report_type과 report_id 기준 조회 인덱스만 유지 * fix(admin): 운영 서버 관리자 로그인 실패 대응 (#181) 관리자 비밀번호 비교 시 앞뒤 공백을 제거하고, 로그인 실패 기본 메시지에 HTTP 상태 코드를 표시하도록 수정
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.
📝 요약(Summary)
개요
리포트 생성 과정에서 발생하는 성공, 실패, 외부 LLM 오류를 공통 로그로 추적할 수 있도록 리포트 생성 로그 구조를 추가했습니다.
이번 변경으로 일간, 주간, 월간, 월간 V2, 유형 리포트 생성 단계별 상태를 동일한 테이블과 서비스로 기록할 수 있습니다.
주요 변경 사항
1. 리포트 생성 로그 저장 구조 추가
report_generation_logs테이블 추가ReportGenerationLog엔티티 추가ReportGenerationType,ReportGenerationStep,ReportGenerationLogStatusenum 추가ReportGenerationLogRepository추가2. 로그 기록 서비스 추가
ReportGenerationLogService추가ReportGenerationLogRecorder추가3. 외부 LLM 오류 분류 개선
AiServiceUnavailableException에 외부 HTTP 상태와 외부 오류 코드 필드 추가BusinessException,AiServiceException에 cause 기반 생성자 추가LlmExceptionMapper추가WebClientResponseException,HttpStatusCodeException,RestClientResponseException에서 HTTP 상태를 추출해 로그에 기록HTTP_{status}형태로 저장4. 리포트 생성 흐름에 로그 연결
5. 테스트 추가
ReportGenerationLogService단위 테스트 추가ReportGenerationLogRepository조회 테스트 추가🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.