|
@@ -50,9 +50,9 @@ public class WebLogAspect {
|
|
|
|
|
|
@Before("controllerLog()") //在切入点的方法run之前要干的
|
|
|
public void logBeforeController(JoinPoint joinPoint) {
|
|
|
-// log.warn("start : {}" , request.getRequestURI());
|
|
|
-// log.info("request Method : {}" , request.getMethod());
|
|
|
-// log.info("request IP : {}" , request.getRemoteAddr());
|
|
|
+ log.info("start : {}" , request.getRequestURI());
|
|
|
+ log.info("request Method : {}" , request.getMethod());
|
|
|
+ log.info("request IP : {}" , request.getRemoteAddr());
|
|
|
log.info("request Args : {}" , Arrays.toString(joinPoint.getArgs()));
|
|
|
|
|
|
// 获取token
|
|
@@ -76,7 +76,6 @@ public class WebLogAspect {
|
|
|
}
|
|
|
|
|
|
String userInfo = redisTemplate.opsForValue().get(token);
|
|
|
-// log.info("redis value: " + userInfo);
|
|
|
|
|
|
if (userInfo == null) {
|
|
|
log.warn("redis 找不到token key: " + token);
|
|
@@ -84,7 +83,7 @@ public class WebLogAspect {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ try {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(userInfo);
|
|
|
log.info("userInfo : " + jsonObject.toString());
|
|
|
|
|
@@ -113,7 +112,7 @@ public class WebLogAspect {
|
|
|
logInfoDto.setCreateTime(now);
|
|
|
logInfoDto.setOperateTime(now);
|
|
|
|
|
|
- try {
|
|
|
+
|
|
|
houseFeign.addLog(logInfoDto);
|
|
|
} catch (Exception e) {
|
|
|
//下面这个getSignature().getDeclaringTypeName()是获取包+类名的 然后后面的joinPoint.getSignature.getName()获取了方法名
|
|
@@ -132,7 +131,7 @@ public class WebLogAspect {
|
|
|
@AfterReturning(returning = "ret", pointcut = "controllerLog()")
|
|
|
public void doAfterReturning(Object ret) throws Throwable {
|
|
|
// 处理完请求,返回内容
|
|
|
- log.warn("end : {}", request.getRequestURI());
|
|
|
+ log.info("end : {}", request.getRequestURI());
|
|
|
}
|
|
|
|
|
|
/**
|