|
@@ -72,10 +72,12 @@ public class TraceIdAspect {
|
|
|
String param = JSON.toJSONString(logArgs);
|
|
String param = JSON.toJSONString(logArgs);
|
|
|
String exception = "";
|
|
String exception = "";
|
|
|
try {
|
|
try {
|
|
|
|
|
+ log.info("请求参数 param:{} ",param);
|
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
|
//执行结果,返回参数
|
|
//执行结果,返回参数
|
|
|
result = joinPoint.proceed();
|
|
result = joinPoint.proceed();
|
|
|
long end = System.currentTimeMillis();
|
|
long end = System.currentTimeMillis();
|
|
|
|
|
+ log.info("响应结果 result:{} ",JSON.toJSONString(result));
|
|
|
log.info("方法耗时:{} ms", end - start);
|
|
log.info("方法耗时:{} ms", end - start);
|
|
|
} catch (Throwable e) {
|
|
} catch (Throwable e) {
|
|
|
exception = e.getMessage();
|
|
exception = e.getMessage();
|
|
@@ -85,13 +87,21 @@ public class TraceIdAspect {
|
|
|
Date endTime = new Date();
|
|
Date endTime = new Date();
|
|
|
long time = endTime.getTime() - startTime.getTime();
|
|
long time = endTime.getTime() - startTime.getTime();
|
|
|
Boolean slowRequest = (time > 1500L);
|
|
Boolean slowRequest = (time > 1500L);
|
|
|
- log.info("{}:{}.{}," +
|
|
|
|
|
- "param={}," +
|
|
|
|
|
- "result={}," +
|
|
|
|
|
|
|
+// log.info("{}:{}.{}," +
|
|
|
|
|
+// "param={}," +
|
|
|
|
|
+// "result={}," +
|
|
|
|
|
+// "exception={}," +
|
|
|
|
|
+// "[{}->{}],slowRequest{}=[{}]", l.description(), targetName, methodName,
|
|
|
|
|
+// param,
|
|
|
|
|
+// JSON.toJSONString(result),
|
|
|
|
|
+// exception,
|
|
|
|
|
+// DateFormatUtils.format(startTime, TIME_PATTERN),
|
|
|
|
|
+// DateFormatUtils.format(endTime, TIME_PATTERN),
|
|
|
|
|
+// slowRequest,
|
|
|
|
|
+// time);
|
|
|
|
|
+ log.info("{}:{}.{}," +
|
|
|
"exception={}," +
|
|
"exception={}," +
|
|
|
"[{}->{}],slowRequest{}=[{}]", l.description(), targetName, methodName,
|
|
"[{}->{}],slowRequest{}=[{}]", l.description(), targetName, methodName,
|
|
|
- param,
|
|
|
|
|
- JSON.toJSONString(result),
|
|
|
|
|
exception,
|
|
exception,
|
|
|
DateFormatUtils.format(startTime, TIME_PATTERN),
|
|
DateFormatUtils.format(startTime, TIME_PATTERN),
|
|
|
DateFormatUtils.format(endTime, TIME_PATTERN),
|
|
DateFormatUtils.format(endTime, TIME_PATTERN),
|