Skip to content

Commit

Permalink
#550 [feat] DISCORD 제거 및 request Id 로깅
Browse files Browse the repository at this point in the history
#550 [feat] DISCORD 제거 및 request Id 로깅
  • Loading branch information
sohyundoh authored Oct 29, 2024
2 parents 969226d + 006559d commit 04056b4
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 855 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mile.common.filter;


import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.UUID;

@Component
public class MDCLoggingFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
final String requestId = UUID.randomUUID().toString();
MDC.put("request_id", requestId);
chain.doFilter(request, response);
MDC.clear();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mile.exception.log.filter;
package com.mile.config;


import com.mile.common.filter.MDCLoggingFilter;
import com.mile.exception.log.filter.CustomServletWrappingFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -16,9 +18,9 @@ public FilterRegistrationBean<CustomServletWrappingFilter> secondFilter() {
}

@Bean
public FilterRegistrationBean<MDCFilter> thirdFilter() {
FilterRegistrationBean<MDCFilter> filterRegistrationBean = new FilterRegistrationBean<>(
new MDCFilter());
public FilterRegistrationBean<MDCLoggingFilter> thirdFilter() {
FilterRegistrationBean<MDCLoggingFilter> filterRegistrationBean = new FilterRegistrationBean<>(
new MDCLoggingFilter());
filterRegistrationBean.setOrder(1);
return filterRegistrationBean;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 04056b4

Please sign in to comment.