Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#550 [feat] DISCORD 제거 및 request Id 로깅 #553

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading