Commit 7a6468ce authored by 张永's avatar 张永

V1.1.7.6

parent 067224da
......@@ -45,9 +45,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
InterceptorRegistration logsRegistration = registry.addInterceptor(logInterceptor).addPathPatterns("/**");
/*InterceptorRegistration logsRegistration = registry.addInterceptor(logInterceptor).addPathPatterns("/**");
logsRegistration.excludePathPatterns("/", "/**.*", "/error");
logsRegistration.excludePathPatterns("/csrf", "/swagger-resources/**", "/webjars/**");
logsRegistration.excludePathPatterns("/csrf", "/swagger-resources/**", "/webjars/**");*/
if(isSign) {
registry.addInterceptor(openInterceptor).addPathPatterns("/**").excludePathPatterns("/pay/**");
......
......@@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.egolm.common.GsonUtil;
import com.egolm.common.LogBackUtil;
import com.egolm.common.MD5Util;
import com.egolm.common.StringUtil;
import com.egolm.common.Util;
......@@ -43,6 +44,16 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
String uri = req.getRequestURI();
if((uri.indexOf("swagger") == -1 && uri.indexOf("/v2/api-docs") == -1) ) {
//设置一个requetId
String traceId = req.getHeader(LogBackUtil.TRACE_ID);
if(!StringUtil.isNotBlank(traceId)) {
traceId = StringUtil.getId();
}
LogBackUtil.setTraceId(traceId);
resp.setHeader(LogBackUtil.TRACE_ID, traceId);
Map<String, String[]> paramMap = req.getParameterMap();
logger.info(uri);
logger.info(GsonUtil.toJson(paramMap));
......
......@@ -6,7 +6,7 @@
<!-- Console 输出设置 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{MM-dd HH:mm:ss.SSS} %-5level [%logger{50}] - %msg%n</pattern>
<pattern>%date [trace_id=%X{trace_id}] %-5level [%logger{50}] - %msg%n</pattern>
<charset>utf8</charset>
</encoder>
</appender>
......@@ -17,7 +17,8 @@
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<pattern>%date [trace_id=%X{trace_id}] %-5level [%logger{50}] %file:%line - %msg%n
</pattern>
</encoder>
</appender>
......
......@@ -24,9 +24,10 @@
</head>
<body>
<div id="app">
<el-divider content-position="left">V1.1.7.6 2024-5-22</el-divider>
<el-divider content-position="left">V1.1.7.6 2024-5-27</el-divider>
<p class="title">1.支付回调失败状态为99的,刚写文件,需求 #16796</p>
<p class="title">2.改取IP方法,需求 #16869</p>
<p class="title">3.日志增加trace_id</p>
<el-divider content-position="left">V1.1.7.5 2024-4-23</el-divider>
<p class="title">1.增加接口签名验证及开关</p>
<p class="title">2.需求 #16555、需求 #16563 需求 #16542,需求 #16595</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment