Skip to content

Commit

Permalink
fix: MDCFilter가 RequestResponseLogger 보다 먼저 실행되게 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
abc5259 committed Aug 23, 2024
1 parent 382c192 commit 437a443
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/dnd/snappy/common/logger/MDCFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
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;
import org.springframework.web.util.ContentCachingResponseWrapper;

@Slf4j
@Component
@Order(2)
public class RequestResponseLogger extends OncePerRequestFilter {

@Override
Expand Down

0 comments on commit 437a443

Please sign in to comment.