fix: EgovPartitionFlatFileItemWriter 예외 로그가 인자 하나를 버려 예외 메시지가 사라지는 문제 수정 - #378
Open
wantaekchoi wants to merge 1 commit into
Open
fix: EgovPartitionFlatFileItemWriter 예외 로그가 인자 하나를 버려 예외 메시지가 사라지는 문제 수정#378wantaekchoi wants to merge 1 commit into
wantaekchoi wants to merge 1 commit into
Conversation
머지된 eGovFramework#249(708baad)가 플레이스홀더를 하나 늘려 예외 클래스명과 메시지를 둘 다 찍게 고쳤는데, 이후 73f7d40 이 그 줄을 원래대로 되돌려 인자 하나가 다시 버려진다. 같은 파일 523줄의 형제 catch 는 두 값을 모두 찍는다.
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.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
EgovPartitionFlatFileItemWriter.OutputState.initializeBufferedWriter()의finally에서stream.close()가IOException을 던질 때 찍는 로그가 플레이스홀더 하나에 인자 둘을 넘깁니다.slf4j 는 자리가 남지 않은 인자를 버립니다. 마지막 인자가
Throwable이 아니라String이라 스택트레이스로도 취급되지 않아 예외 메시지가 로그에서 사라집니다.같은 파일의 형제 catch 는 두 값을 모두 찍습니다.
이 줄은 이미 한 번 고쳐졌습니다.
708baad(#249, 2026-07-28 머지)가 플레이스홀더를 하나 늘렸습니다.그 뒤
73f7d40("NCSC&NIA 보안점검 적용")이 같은 줄을 되돌렸습니다. 그 커밋은 29개 파일을 함께 바꿨고 이 파일에서는 이 한 줄만 건드렸습니다. 형제 catch 는 손대지 않아 지금도 두 값을 찍습니다.되돌림이 예외 메시지를 로그에서 빼려는 조치는 아니었습니다. 같은 커밋은
EgovDOMValidatorService에서e.getMessage()를 찍던debug세 줄을 지우면서 그 값을 던지는 예외의 메시지로 옮겼습니다.같은 커밋이
EgovSAXValidatorService의 로그도 예외 클래스명과 메시지를 모두 찍는 형태로 바꿨고, 그 줄은 현재main에 그대로 있습니다.AS-IS
TO-BE
영향 범위
로그 문자열만 달라지고 제어 흐름은 그대로입니다. 이
catch는 초기화 도중 예외가 나서finally가stream.close()를 부르고 그close()마저 실패할 때만 탑니다.JUnit 테스트 JUnit tests
새 테스트는 추가하지 않았습니다.
LOGGER출력을 잡아 어서션하는 테스트가 이 모듈에 없어 아래 두 가지로 확인했습니다.모듈이 쓰는
slf4j-api-2.0.17의MessageFormatter.arrayFormat으로 두 형식에 같은 인자를 넣어 결과 문자열을 비교했습니다.첫 줄이 수정 전, 둘째 줄이 수정 후입니다. 수정 전에는
e.getMessage()가 결과에 들어가지 않습니다.모듈 테스트도 돌렸습니다.
테스트 브라우저 Test Browser
서버 측 로깅이라 브라우저 테스트는 진행하지 않았습니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
화면이 없는 실행환경 모듈이라 첨부하지 않았습니다. 검증은 위 「JUnit 테스트」 절의 출력으로 대신합니다.