调整日志打印参数优先级

This commit is contained in:
2026-04-25 11:33:05 +08:00
parent 36ec316998
commit 07be576c06
2 changed files with 22 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package xtools.boot.web.base.exception;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.connector.ClientAbortException;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
@@ -147,6 +148,19 @@ public class GlobalControllerExceptionHandler implements BaseParams {
return new Result<>(ResultType.NOT_FOUND, null);
}
/**
* 客户端提前断开连接
*
* @param e 客户端提前断开连接异常
* @param request 请求
*/
@ExceptionHandler(ClientAbortException.class)
public void handleClientAbortException(ClientAbortException e, HttpServletRequest request) {
String title = "客户端提前断开连接";
LogBus.init(LogLevel.WARN, LogBusBaseType.HTTP_RESPONSE).print(false).error(e).title(title).save();
logException(title, e.getMessage(), request, e);
}
/**
* 认证异常
*
@@ -160,7 +174,6 @@ public class GlobalControllerExceptionHandler implements BaseParams {
return new Result<>(ResultType.UNAUTHORIZED, null);
}
/**
* 公钥错误
*