diff --git a/backend/emm-sale/src/main/java/com/emmsale/GlobalControllerAdvice.java b/backend/emm-sale/src/main/java/com/emmsale/GlobalControllerAdvice.java index 656b91fd1..5747130a6 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/GlobalControllerAdvice.java +++ b/backend/emm-sale/src/main/java/com/emmsale/GlobalControllerAdvice.java @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; -@RestControllerAdvice @Slf4j +@RestControllerAdvice public class GlobalControllerAdvice { @ExceptionHandler(BaseException.class) @@ -23,7 +23,8 @@ public ResponseEntity handleException(final BaseException e) final BaseExceptionType type = e.exceptionType(); if (type.httpStatus().is5xxServerError()) { - log.error("[ERROR] MESSAGE : {}, 로그 캡처와 함께 서버 개발자에게 연락주세요 : ", type.errorMessage(), e); + log.error("[ERROR] MESSAGE : {}, 로그 캡처와 함께 서버 개발자에게 연락주세요 : ", type.errorMessage(), + e); return new ResponseEntity<>(ExceptionResponse.from(e), HttpStatus.INTERNAL_SERVER_ERROR); } @@ -52,7 +53,7 @@ public ResponseEntity handleHttpMessageNotReadableException( @ExceptionHandler(MissingServletRequestParameterException.class) public ResponseEntity handleMissingServletRequestParameterException( final MissingServletRequestParameterException e) { - final String message = "요청 파라미터가 올바르지 않습니다.."; + final String message = "요청 파라미터가 올바르지 않습니다."; log.warn("[WARN] MESSAGE: " + message); return new ResponseEntity<>(new ExceptionResponse(message), HttpStatus.BAD_REQUEST); } diff --git a/backend/emm-sale/src/main/resources/logback.xml b/backend/emm-sale/src/main/resources/logback.xml new file mode 100644 index 000000000..f6abfc12a --- /dev/null +++ b/backend/emm-sale/src/main/resources/logback.xml @@ -0,0 +1,78 @@ + + + + + + + ${LOG_PATTERN} + + + + + + logs/info.log + + INFO + ACCEPT + DENY + + + ${LOG_PATTERN} + + + + + logs/info.%d{yyyy-MM-dd}.log + 7 + + + + + logs/warn.log + + WARN + ACCEPT + DENY + + + ${LOG_PATTERN} + + + + + logs/warn.%d{yyyy-MM-dd}.log + 7 + + + + + logs/error.log + + ERROR + ACCEPT + DENY + + + ${LOG_PATTERN} + + + + + logs/error.%d{yyyy-MM-dd}.log + 7 + + + + + + + + + + + + + + +