From 4c1bd8197fc093c18455da23e55542a147b7e46c Mon Sep 17 00:00:00 2001 From: pwy9679 Date: Tue, 3 Feb 2026 15:28:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wypark/blogbackend/core/error/GlobalExceptionHandler.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/me/wypark/blogbackend/core/error/GlobalExceptionHandler.kt b/src/main/kotlin/me/wypark/blogbackend/core/error/GlobalExceptionHandler.kt index 9e41ddc..6902676 100644 --- a/src/main/kotlin/me/wypark/blogbackend/core/error/GlobalExceptionHandler.kt +++ b/src/main/kotlin/me/wypark/blogbackend/core/error/GlobalExceptionHandler.kt @@ -1,6 +1,7 @@ package me.wypark.blogbackend.core.error import me.wypark.blogbackend.api.common.ApiResponse +import org.slf4j.LoggerFactory import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.MethodArgumentNotValidException @@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.RestControllerAdvice @RestControllerAdvice class GlobalExceptionHandler { + private val log = LoggerFactory.getLogger(this.javaClass)!! + /** * [비즈니스 로직 예외 처리] * @@ -58,7 +61,7 @@ class GlobalExceptionHandler { */ @ExceptionHandler(Exception::class) fun handleException(e: Exception): ResponseEntity> { - e.printStackTrace() // 실제 운영 환경에서는 SLF4J 등의 로거를 사용하여 파일/ELK로 수집해야 함 + log.error("Error occurred: ", e) return ResponseEntity .status(HttpStatus.INTERNAL_SERVER_ERROR) .body(ApiResponse.error("서버 내부 오류가 발생했습니다."))