Commit a179305b authored by yanzg's avatar yanzg

常规BUG的修改

parent 4fb7598b
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.yanzuoguang.cloud.CloudContans; import com.yanzuoguang.cloud.CloudContans;
import com.yanzuoguang.util.cache.MemoryCache; import com.yanzuoguang.util.cache.MemoryCache;
import com.yanzuoguang.util.contants.ResultConstants; import com.yanzuoguang.util.contants.ResultConstants;
import com.yanzuoguang.util.exception.ExceptionHelper;
import com.yanzuoguang.util.helper.JsonHelper; import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.log.Log; import com.yanzuoguang.util.log.Log;
...@@ -153,7 +154,6 @@ public class BaseRequestAspect implements ThreadNext.Next { ...@@ -153,7 +154,6 @@ public class BaseRequestAspect implements ThreadNext.Next {
protected void responseLog(String tag, String url, ProceedingJoinPoint joinPoint, long start, Object result, Exception resultEx) { protected void responseLog(String tag, String url, ProceedingJoinPoint joinPoint, long start, Object result, Exception resultEx) {
try { try {
String name = joinPoint.getSignature().getName(); String name = joinPoint.getSignature().getName();
// 处理结果 // 处理结果
ResponseResult responseResult; ResponseResult responseResult;
if (result instanceof ResponseResult) { if (result instanceof ResponseResult) {
...@@ -164,8 +164,10 @@ public class BaseRequestAspect implements ThreadNext.Next { ...@@ -164,8 +164,10 @@ public class BaseRequestAspect implements ThreadNext.Next {
long time = System.currentTimeMillis() - start; long time = System.currentTimeMillis() - start;
if (resultEx != null) { if (resultEx != null) {
Log.error(joinPoint.getSignature().getDeclaringType(), "%s [ %s ] time %d ms, error: %s", responseResult = ExceptionHelper.getError(resultEx);
tag, name, time, getMaxString(resultEx.getMessage())); Log.error(joinPoint.getSignature().getDeclaringType(), "%s [ %s ] time %d ms, result: %s",
tag, name, time, getMaxString(JsonHelper.serialize(responseResult)));
resultEx.printStackTrace();
} else { } else {
Log.info(joinPoint.getSignature().getDeclaringType(), "%s [ %s ] time %d ms, result: %s", Log.info(joinPoint.getSignature().getDeclaringType(), "%s [ %s ] time %d ms, result: %s",
tag, name, time, getMaxString(JsonHelper.serialize(responseResult))); tag, name, time, getMaxString(JsonHelper.serialize(responseResult)));
......
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