common-trace去掉请求wrapper包装类
This commit is contained in:
parent
e8605c2aa5
commit
82d85e447d
@ -50,10 +50,6 @@ public class RequestLogHandlerInterceptor implements HandlerInterceptor, WebMvcC
|
|||||||
if (request.getDispatcherType().equals(DispatcherType.ERROR)) {
|
if (request.getDispatcherType().equals(DispatcherType.ERROR)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(request instanceof BodyReaderHttpServletRequestWrapper)) {
|
|
||||||
log.warn("print request log error : current request entity not support");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String method = request.getMethod();
|
String method = request.getMethod();
|
||||||
StringBuffer requestUrl = request.getRequestURL();
|
StringBuffer requestUrl = request.getRequestURL();
|
||||||
|
|
||||||
|
|||||||
@ -38,16 +38,8 @@ public class TraceIdFilter extends OncePerRequestFilter {
|
|||||||
protected void doFilterInternal(@NonNull HttpServletRequest request,
|
protected void doFilterInternal(@NonNull HttpServletRequest request,
|
||||||
@NonNull HttpServletResponse response,
|
@NonNull HttpServletResponse response,
|
||||||
@NonNull FilterChain filterChain) throws ServletException, IOException {
|
@NonNull FilterChain filterChain) throws ServletException, IOException {
|
||||||
|
|
||||||
// wrapper
|
|
||||||
BodyReaderHttpServletRequestWrapper bodyRequest = new BodyReaderHttpServletRequestWrapper(
|
|
||||||
request);
|
|
||||||
|
|
||||||
// trace id 补充
|
// trace id 补充
|
||||||
|
ExceptionUtil.ignoreException(() -> setTraceId(request, response), null);
|
||||||
ExceptionUtil.ignoreException(() -> setTraceId(bodyRequest, response), null);
|
|
||||||
|
|
||||||
|
|
||||||
//do
|
//do
|
||||||
try {
|
try {
|
||||||
filterChain.doFilter(request, response);
|
filterChain.doFilter(request, response);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user