Skip to content

Commit

Permalink
[BE] 에러 로깅 레벨 변경: warn → error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinwook94 committed Dec 31, 2023
1 parent 4e4151d commit 6fc86a9
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -29,7 +29,7 @@ public class GlobalExceptionHandler {
public ResponseEntity<ErrorResponse> methodArgumentExceptionHandler(final MethodArgumentNotValidException e,
HttpServletRequest request) throws JsonProcessingException {
MDC.put(REQUEST_INFO, getRequestInfo(request));
log.warn("Method Argument Not Valid Exception", e);
log.error("Method Argument Not Valid Exception", e);
String errorMessage = e.getBindingResult()
.getFieldErrors()
.get(0)
Expand All @@ -43,7 +43,7 @@ public ResponseEntity<ErrorResponse> badRequestExceptionHandler(final BadRequest
HttpServletRequest request,
HttpServletResponse response) throws JsonProcessingException {
MDC.put(REQUEST_INFO, getRequestInfo(request));
log.warn("Bad Request Exception", e);
log.error("Bad Request Exception", e);
ErrorType errorType = e.getErrorType();
MDC.remove(REQUEST_INFO);

Expand All @@ -54,7 +54,7 @@ public ResponseEntity<ErrorResponse> badRequestExceptionHandler(final BadRequest
@ExceptionHandler(UnauthorizedException.class)
public ResponseEntity<ErrorResponse> unauthorizedExceptionHandler(final UnauthorizedException e, HttpServletRequest request) throws JsonProcessingException {
MDC.put(REQUEST_INFO, getRequestInfo(request));
log.warn("Unauthorized Exception", e);
log.error("Unauthorized Exception", e);
ErrorType errorType = e.getErrorType();
MDC.remove(REQUEST_INFO);
return ResponseEntity.status(UNAUTHORIZED).body(ErrorResponse.of(errorType));
Expand All @@ -63,7 +63,7 @@ public ResponseEntity<ErrorResponse> unauthorizedExceptionHandler(final Unauthor
@ExceptionHandler(ForbiddenException.class)
public ResponseEntity<ErrorResponse> forbiddenExceptionHandler(final ForbiddenException e, HttpServletRequest request) throws JsonProcessingException {
MDC.put(REQUEST_INFO, getRequestInfo(request));
log.warn("Forbidden Exception", e);
log.error("Forbidden Exception", e);
ErrorType errorType = e.getErrorType();
MDC.remove(REQUEST_INFO);
return ResponseEntity.status(FORBIDDEN).body(ErrorResponse.of(errorType));
Expand All @@ -72,7 +72,7 @@ public ResponseEntity<ErrorResponse> forbiddenExceptionHandler(final ForbiddenEx
@ExceptionHandler(RuntimeException.class)
public ResponseEntity<ErrorResponse> handleRuntimeException(RuntimeException e, HttpServletRequest request) throws JsonProcessingException {
MDC.put(REQUEST_INFO, getRequestInfo(request));
log.warn("Runtime Exception", e);
log.error("Runtime Exception", e);
MDC.remove(REQUEST_INFO);
return ResponseEntity.internalServerError().body(ErrorResponse.of(RUNTIME_EXCEPTION));
}
Expand Down

0 comments on commit 6fc86a9

Please sign in to comment.