Commit bed62e59 authored by yanzg's avatar yanzg

不记录系统日志

parent 68166749
...@@ -183,6 +183,10 @@ public class BaseRequestAspect { ...@@ -183,6 +183,10 @@ public class BaseRequestAspect {
return start; return start;
} }
protected void writeLogBody(LogVo log, String requestBody) {
}
/** /**
* 保存日志 * 保存日志
* *
...@@ -191,12 +195,16 @@ public class BaseRequestAspect { ...@@ -191,12 +195,16 @@ public class BaseRequestAspect {
* @param url * @param url
* @param logFlag * @param logFlag
* @param start * @param start
* @param requestBody
* @param result * @param result
* @param resultEx * @param resultEx
* @param log * @param log
*/ */
protected void responseLog(Class<?> cls, String tag, String url, boolean logFlag, long start, Object result, Exception resultEx, LogVo log) { protected void responseLog(Class<?> cls, String tag, String url, boolean logFlag, long start,
String requestBody, Object result, Exception resultEx, LogVo log) {
try { try {
log.setContent(requestBody);
long time = System.currentTimeMillis() - start; long time = System.currentTimeMillis() - start;
boolean isLogDisplay = (logFlag && logCommon) || resultEx != null; boolean isLogDisplay = (logFlag && logCommon) || resultEx != null;
boolean isLogDatabase = log != null || resultEx != null; boolean isLogDatabase = log != null || resultEx != null;
......
...@@ -67,7 +67,7 @@ public class FeignAspect extends BaseRequestAspect { ...@@ -67,7 +67,7 @@ public class FeignAspect extends BaseRequestAspect {
ex = e; ex = e;
throw e; throw e;
} finally { } finally {
responseLog(declaringType, TAG, url, clear, start, result, ex, log); responseLog(declaringType, TAG, url, clear, start, getRequestBody(joinPoint), result, ex, log);
} }
} }
......
...@@ -62,7 +62,7 @@ public class MqAspect extends BaseRequestAspect { ...@@ -62,7 +62,7 @@ public class MqAspect extends BaseRequestAspect {
ex = e; ex = e;
throw e; throw e;
} finally { } finally {
responseLog(declaringType, TAG, url, clear, start, result, ex, log); responseLog(declaringType, TAG, url, clear, start, getRequestBody(joinPoint), result, ex, log);
} }
} }
......
...@@ -120,7 +120,7 @@ public class WebAspect extends BaseRequestAspect { ...@@ -120,7 +120,7 @@ public class WebAspect extends BaseRequestAspect {
if (isInit) { if (isInit) {
TokenHelper.remove(); TokenHelper.remove();
} }
responseLog(declaringType, TAG, url, clear, start, result, ex, log); responseLog(declaringType, TAG, url, clear, start, getRequestBody(joinPoint), result, ex, log);
} }
} }
......
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