Преглед изворни кода

优化异常日志记录格式

wangyunpeng пре 7 часа
родитељ
комит
75f06c0317

+ 4 - 4
core/src/main/java/com/tzld/videoVector/handle/GlobalExceptionHandle.java

@@ -33,7 +33,7 @@ public class GlobalExceptionHandle {
             CommonException e = (CommonException) exception;
             CommonException e = (CommonException) exception;
             response.setCode(e.getCode());
             response.setCode(e.getCode());
             response.setMsg(e.getMsg());
             response.setMsg(e.getMsg());
-            LOGGER.info("uri:" + uri + "\n" + "CustomException log.", exception, exception.getMessage());
+            LOGGER.info("uri:" + uri + "\n" + "CustomException log.", exception);
         } else if (exception instanceof MethodArgumentNotValidException) {
         } else if (exception instanceof MethodArgumentNotValidException) {
             // 参数校验异常
             // 参数校验异常
             MethodArgumentNotValidException e = (MethodArgumentNotValidException) exception;
             MethodArgumentNotValidException e = (MethodArgumentNotValidException) exception;
@@ -47,7 +47,7 @@ public class GlobalExceptionHandle {
             }
             }
             response.setCode(ExceptionEnum.PARAM_ERROR.getCode());
             response.setCode(ExceptionEnum.PARAM_ERROR.getCode());
             response.setMsg(errorMsg.toString());
             response.setMsg(errorMsg.toString());
-            LOGGER.error("uri:" + uri + "\n" + "MethodArgumentNotValidException log.", exception, exception.getMessage());
+            LOGGER.error("uri:" + uri + "\n" + "MethodArgumentNotValidException log.", exception);
         } else if (exception instanceof BindException) {
         } else if (exception instanceof BindException) {
             // 参数绑定异常
             // 参数绑定异常
             BindException e = (BindException) exception;
             BindException e = (BindException) exception;
@@ -61,11 +61,11 @@ public class GlobalExceptionHandle {
             }
             }
             response.setCode(ExceptionEnum.PARAM_ERROR.getCode());
             response.setCode(ExceptionEnum.PARAM_ERROR.getCode());
             response.setMsg(errorMsg.toString());
             response.setMsg(errorMsg.toString());
-            LOGGER.error("uri:" + uri + "\n" + "BindException log.", exception, exception.getMessage());
+            LOGGER.error("uri:" + uri + "\n" + "BindException log.", exception);
         } else {
         } else {
             response.setCode(ExceptionEnum.SYSTEM_ERROR.getCode());
             response.setCode(ExceptionEnum.SYSTEM_ERROR.getCode());
             response.setMsg(ExceptionEnum.SYSTEM_ERROR.getMsg());
             response.setMsg(ExceptionEnum.SYSTEM_ERROR.getMsg());
-            LOGGER.error("uri:" + uri + "\n" + "unknownException log.", exception, exception.getMessage());
+            LOGGER.error("uri:" + uri + "\n" + "unknownException log.", exception);
         }
         }
         return response;
         return response;
     }
     }

+ 1 - 1
server/src/main/resources/application-prod.yml

@@ -15,7 +15,7 @@ spring:
         connection-test-query: SELECT 1
         connection-test-query: SELECT 1
 
 
   redis:
   redis:
-    host: r-bp1zg8fw8db0vxdo2m.redis.rds.aliyuncs.com
+    host: r-bp1zg8fw8db0vxdo2mpd.redis.rds.aliyuncs.com
     port: 6379
     port: 6379
     username: r-bp1zg8fw8db0vxdo2m
     username: r-bp1zg8fw8db0vxdo2m
     password: Wqsd@2026
     password: Wqsd@2026