From 437a4436da3d4f038c9cbcbea6c9e11160351526 Mon Sep 17 00:00:00 2001 From: LeeJaeHoon Date: Fri, 23 Aug 2024 23:41:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20MDCFilter=EA=B0=80=20RequestResponseLogg?= =?UTF-8?q?er=20=EB=B3=B4=EB=8B=A4=20=EB=A8=BC=EC=A0=80=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EB=90=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/dnd/snappy/common/logger/MDCFilter.java | 2 ++ .../com/dnd/snappy/common/logger/RequestResponseLogger.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/com/dnd/snappy/common/logger/MDCFilter.java b/src/main/java/com/dnd/snappy/common/logger/MDCFilter.java index 6322735..49d8272 100644 --- a/src/main/java/com/dnd/snappy/common/logger/MDCFilter.java +++ b/src/main/java/com/dnd/snappy/common/logger/MDCFilter.java @@ -9,10 +9,12 @@ import java.util.UUID; import lombok.extern.slf4j.Slf4j; import org.slf4j.MDC; +import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Slf4j @Component +@Order(1) public class MDCFilter implements Filter { private final String REQUEST_ID = "request_id"; diff --git a/src/main/java/com/dnd/snappy/common/logger/RequestResponseLogger.java b/src/main/java/com/dnd/snappy/common/logger/RequestResponseLogger.java index 564eb33..e47244a 100644 --- a/src/main/java/com/dnd/snappy/common/logger/RequestResponseLogger.java +++ b/src/main/java/com/dnd/snappy/common/logger/RequestResponseLogger.java @@ -7,6 +7,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import lombok.extern.slf4j.Slf4j; +import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; import org.springframework.web.util.ContentCachingRequestWrapper; @@ -14,6 +15,7 @@ @Slf4j @Component +@Order(2) public class RequestResponseLogger extends OncePerRequestFilter { @Override