예외 로깅 레벨 4xx/5xx 분리#246
Open
ckdals4600 wants to merge 1 commit into
Open
Conversation
📊 코드 커버리지 리포트
|
Goder-0
reviewed
Jun 21, 2026
fd18b29 to
2c0b406
Compare
Goder-0
reviewed
Jun 28, 2026
| @ExceptionHandler(MethodArgumentNotValidException.class) | ||
| public ResponseEntity<BaseResponse<String>> handleMethodArgumentNotValid(MethodArgumentNotValidException ex) { | ||
| log.error(ex.getMessage(), ex); | ||
| log.warn("Validation failed: {}", ex.getMessage()); |
Contributor
There was a problem hiding this comment.
MethodArgumentNotValidException에서 ex.getMessage()를 그대로 WARN에 남기면 rejected value가 로그에 섞일 수 있습니다. 회원가입/로그인 같은 검증 실패에서 사용자 입력값이 그대로 남을 수 있어서, 고정 문구나 field name / error count 정도만 남기는 쪽이 더 안전해 보입니다.
| return ResponseEntity.notFound().build(); | ||
| } | ||
| log.error("No static resource {}", exception.getResourcePath(), exception); | ||
| log.warn("No static resource: {}", exception.getResourcePath()); |
Contributor
There was a problem hiding this comment.
PR 설명 수정이 필요해보입니다. 본문에는 “봇 스캔성 404 등 고빈도 노이즈는 DEBUG”라고 적혀 있는데, 현재 구현은 NoResourceFoundException을 WARN으로 남기고 있습니다.
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.
관련 이슈
PR 설명
배경
log.error(ex.getMessage(), ex)로 동일하게 로깅하여,클라이언트 잘못인 4xx(검증 실패, 405, 404 등)까지 ERROR + 풀스택으로 기록됨.
Request method 'POST' is not supported,채팅을 찾을 수 없습니다등이 ERROR 로 다수 확인됨.적용된 로깅 원칙
변경 사항
WARN, 스택 트레이스 없이 핵심 필드만 기록BusinessException→ErrorCode.getStatus()로 분기: 5xx만 ERROR + 스택, 4xx는 WARNException(예상 못 한 5xx) →ERROR+ 풀스택 유지, 예외 객체를 인자로 전달