|
|
@@ -53,19 +53,21 @@ public class LogAspect {
|
|
|
Long startTime = System.currentTimeMillis();
|
|
|
Object obj = null;
|
|
|
Exception exception = null;
|
|
|
+ List<Object> param = new ArrayList<>();
|
|
|
try {
|
|
|
+ param = Arrays.stream(point.getArgs()).filter(item -> Objects.nonNull(item) && !isFilterObject(item)).collect(Collectors.toList());
|
|
|
obj = point.proceed();
|
|
|
} catch (Exception e) {
|
|
|
exception = e;
|
|
|
throw e;
|
|
|
} finally {
|
|
|
Long endTime = System.currentTimeMillis();
|
|
|
- handleLog(point, exception, obj, endTime - startTime);
|
|
|
+ handleLog(point,param, exception, obj, endTime - startTime);
|
|
|
}
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
- protected void handleLog(final JoinPoint joinPoint, final Exception e, Object retValue, long time) {
|
|
|
+ protected void handleLog(final JoinPoint joinPoint, List<Object> param, final Exception e, Object retValue, long time) {
|
|
|
try {
|
|
|
// 获得注解
|
|
|
Signature signature = joinPoint.getSignature();
|
|
|
@@ -86,8 +88,8 @@ public class LogAspect {
|
|
|
String methodName = joinPoint.getSignature().getName();
|
|
|
sysLog.setRequsetMethod(className + "." + methodName + "()");
|
|
|
|
|
|
- List<Object> objectList = Arrays.stream(joinPoint.getArgs()).filter(item -> Objects.nonNull(item) && !isFilterObject(item)).collect(Collectors.toList());
|
|
|
- sysLog.setRequsetParams(JSONUtil.toJsonStr(objectList));
|
|
|
+
|
|
|
+ sysLog.setRequsetParams(JSONUtil.toJsonStr(param));
|
|
|
sysLog.setResponseResult(JSONUtil.toJsonStr(retValue));
|
|
|
sysLog.setRequsetTime(String.valueOf(time));
|
|
|
|