Commit 8fc8b29d authored by yanzg's avatar yanzg

修复异常提醒,从而正确的跟踪异常信息

parent 808565c0
......@@ -5,6 +5,7 @@ import com.yanzuoguang.log.LogInfoVo;
import com.yanzuoguang.log.LogString;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.exception.ExceptionHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.ResponseResult;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -55,10 +56,13 @@ public class AspectFeign {
public Object requestFeignAround(ProceedingJoinPoint joinPoint) throws Throwable {
Class<?> declaringType = joinPoint.getSignature().getDeclaringType();
AspectLogUrl.WebUrlInfo webMethodUrl = aspectLogUrl.getWebMethodBaseUrl(joinPoint);
Object requestBody = aspectLogBody.getRequestBody(joinPoint);
boolean clear = aspectLog.requestLogInit();
String bodyString = String.format("地址:%s 内容:%s", webMethodUrl.getRequestUrl(), logString.getBodyString(requestBody));
Object requestBody = aspectLogBody.getRequestBody(joinPoint);
String bodyStringFrom = logString.getBodyString(requestBody);
String bodyString = StringHelper.compare(webMethodUrl.getRequestUrl(), webMethodUrl.getConfigUrl()) ? bodyStringFrom
: String.format("地址:%s 内容:%s", webMethodUrl.getRequestUrl(), bodyStringFrom);
LogInfoVo log = aspectLog.start(declaringType, TAG, webMethodUrl.getConfigUrl(), bodyString, clear);
Object result = null;
Exception ex = null;
......
......@@ -7,6 +7,7 @@ import com.yanzuoguang.log.LogString;
import com.yanzuoguang.token.TokenHelper;
import com.yanzuoguang.util.exception.ExceptionHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.helper.TypeHelper;
import com.yanzuoguang.util.helper.UrlHelper;
import com.yanzuoguang.util.log.Log;
......@@ -96,7 +97,9 @@ public class AspectWeb {
boolean clear = aspectLog.requestLogInit();
Object requestBody = aspectLogBody.getRequestBody(joinPoint);
String bodyString = String.format("地址:%s 内容:%s", webMethodUrl.getRequestUrl(), logString.getBodyString(requestBody));
String bodyStringFrom = logString.getBodyString(requestBody);
String bodyString = StringHelper.compare(webMethodUrl.getRequestUrl(), webMethodUrl.getConfigUrl()) ? bodyStringFrom
: String.format("地址:%s 内容:%s", webMethodUrl.getRequestUrl(), bodyStringFrom);
LogInfoVo log = aspectLog.start(declaringType, TAG, UrlHelper.getPage(webMethodUrl.getConfigUrl()), bodyString, clear);
Exception ex = null;
......
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