Repository navigation
feat: 대용량 디버그 로그의 근본 원인 정제 지원 - #2
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.
문제
실제 Spring DEBUG 로그가 입력 제한을 쉽게 초과함
Spring Boot를 DEBUG로 실행하면 클래스패스, 컴포넌트 스캔, Condition Evaluation Report가 함께 출력되어 로그가 100,000자를 넘는 경우가 있습니다.
기존 백엔드는 프롬프트 준비 요청을 100,000자로 제한했습니다. 로그 정제를 목적으로 하는 도구가 긴 로그에서 다시 핵심 구간을 수동 선택하도록 요구해 사용자 경험과 기능 목적이 맞지 않았습니다.
첫 번째
Exception또는Error가 실제 원인이라는 보장이 없음기존 정제기는 로그에서 처음 발견한
Caused by:,Exception,Error문자열을 기준으로 잘랐습니다. 이 방식은InvalidErrorException.class,ErrorMvcAutoConfiguration같은 DEBUG 클래스명을 실제 오류로 오인하고, 뒤쪽에 있는 데이터베이스 연결 실패 등의 근본 원인을 제외할 수 있었습니다.판단과 선택
원본 입력은 확대하고 LLM 입력은 제한
프롬프트 준비 API의
rawLog와selectedText를 각각 최대 1,000,000자까지 허용했습니다.제한을 없애는 방식은 선택하지 않았습니다. 비정상적으로 큰 요청이 메모리와 처리 시간을 점유하는 것을 막기 위해 입력 안전 한도는 유지하고, 민감정보 마스킹과 반복 압축을 적용한 뒤 LLM에 사용되는 정제 로그는 기존과 동일하게 최대 12,000자로 제한했습니다.
따라서 실제 개발 로그의 수용 범위는 넓히면서 LLM 토큰 비용과 프롬프트 크기는 증가시키지 않습니다.
가장 깊은 실제 원인을 우선
모든 오류 후보를 검사한 뒤 마지막
Caused by:를 가장 높은 우선순위로 사용합니다. 해당 항목이 없을 때만 실제 예외 선언,Exception in thread,Suppressed, 구조화된ERROR,APPLICATION FAILED TO START를 순서대로 사용합니다.패턴을 줄 시작과 예외 클래스 형태로 제한하여 DEBUG 출력에 등장하는 클래스명과 설정 클래스는 오류 앵커로 사용하지 않습니다.
변경 내용
Caused by:중심으로 로그 정제ERROR로그 형식 fallback 지원Error·Exception오탐 방지검증
2026-09-08 09:03:22 ERROR ...형식 인식 확인git diff --check통과호환성 및 운영 참고
POST /api/v1/audit의 기존 100,000자 제한은 유지