Commit 8806a540 authored by yanzg's avatar yanzg

常规BUG的修改

parent 6f6143b5
......@@ -5,9 +5,4 @@ package com.yanzuoguang.cloud;
* @author 颜佐光
*/
public class CloudContans {
/**
* 日志模块
*/
public static final String LOG_MODULE = "log";
}
......@@ -42,6 +42,12 @@ public class BaseRequestAspect implements ThreadNext.Next {
@Value("${yzg.reqSize:5000}")
private int reqSize;
@Value("${yzg.log.notFilter:login}")
private String notFilter;
@Value("${yzg.log.filter:log}")
private String filter;
@Autowired
protected ApplicationContext context;
......@@ -166,9 +172,7 @@ public class BaseRequestAspect implements ThreadNext.Next {
}
// 日志请求不记录,防止死循环递归
boolean isLog = applicationName.indexOf(CloudContans.LOG_MODULE) >= 0
|| name.indexOf(CloudContans.LOG_MODULE) >= 0
|| url.indexOf(CloudContans.LOG_MODULE) >= 0;
boolean isLog = isLog(name, url);
if (isLog) {
return;
}
......@@ -189,6 +193,23 @@ public class BaseRequestAspect implements ThreadNext.Next {
}
}
/**
* 是否属于日志服务
*
* @param name
* @param url
* @return
*/
private boolean isLog(String name, String url) {
boolean notFilter = applicationName.matches(filter) || name.matches(filter) || url.matches(filter);
if (notFilter) {
return false;
}
boolean isLog = applicationName.matches(filter) || name.matches(filter) || url.matches(filter);
return isLog;
}
/**
* 执行下一个函数,出现异常会继续执行
*
......
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