Commit 68166749 authored by yanzg's avatar yanzg

不记录系统日志

parent 93255d30
......@@ -3,7 +3,6 @@ package com.yanzuoguang.cloud.aop;
import com.yanzuoguang.util.contants.ResultConstants;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.exception.ExceptionHelper;
import com.yanzuoguang.util.log.Log;
import com.yanzuoguang.util.vo.LogVo;
import com.yanzuoguang.util.vo.ResponseResult;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -38,16 +37,13 @@ public class FeignAspect extends BaseRequestAspect {
*/
@Around(value = "feignAspect()")
public Object requestFeignAround(ProceedingJoinPoint joinPoint) throws Throwable {
LogVo log = null;
boolean clear = requestLogInit();
long start = System.currentTimeMillis();
Class declaringType = joinPoint.getSignature().getDeclaringType();
String url = getMethodUrl(joinPoint);
log = startLog(TAG, url, getRequestBody(joinPoint));
clear = clear && log != null;
if (clear) {
Log.threadBegin();
start = requestLog(TAG, clear, joinPoint);
}
String requestBody = getRequestBody(joinPoint);
boolean clear = requestLogInit();
long start = requestLog(declaringType, TAG, url, requestBody, clear);
LogVo log = startLog(TAG, url, requestBody);
Object result = null;
Exception ex = null;
......@@ -71,7 +67,7 @@ public class FeignAspect extends BaseRequestAspect {
ex = e;
throw e;
} finally {
responseLog(log, TAG, url, clear, joinPoint, start, result, ex);
responseLog(declaringType, TAG, url, clear, start, result, ex, log);
}
}
......
......@@ -2,7 +2,6 @@ package com.yanzuoguang.cloud.aop;
import com.yanzuoguang.mq.plan.YzgMqConsumer;
import com.yanzuoguang.util.exception.ExceptionHelper;
import com.yanzuoguang.util.log.Log;
import com.yanzuoguang.util.vo.LogVo;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -43,17 +42,15 @@ public class MqAspect extends BaseRequestAspect {
@Around(value = "mqAspect()")
public Object requestWebAround(ProceedingJoinPoint joinPoint) throws Throwable {
boolean clear = isRabbit(joinPoint);
LogVo log = null;
long start = System.currentTimeMillis();
String url = getMethodUrl(joinPoint);
if (clear) {
log = startLog(TAG, url, getRequestBody(joinPoint));
clear = clear && log != null;
}
if (clear) {
Log.threadBegin();
start = requestLog(TAG, clear, joinPoint);
clear = clear && requestLogInit();
}
Class declaringType = joinPoint.getSignature().getDeclaringType();
String url = getMethodUrl(joinPoint);
String requestBody = getRequestBody(joinPoint);
long start = requestLog(declaringType, TAG, url, requestBody, clear);
LogVo log = startLog(TAG, url, requestBody);
Object result = null;
Exception ex = null;
try {
......@@ -65,7 +62,7 @@ public class MqAspect extends BaseRequestAspect {
ex = e;
throw e;
} finally {
responseLog(log, TAG, url, clear, joinPoint, start, result, ex);
responseLog(declaringType, TAG, url, clear, start, 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