We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.1.4
日志管理,没有记录查询接口参数
AutoLogAspect.java
//请求的参数 Object[] args = joinPoint.getArgs(); try{ String params = JSONObject.toJSONString(args); sysLog.setRequestParam(params); }catch (Exception e){ }
---------------我是这么处理的---------------------- //请求的参数 Object[] args = joinPoint.getArgs(); try{ String params = this.getReqestParams(request,joinPoint); sysLog.setRequestParam(params); }catch (Exception e){
} private String getReqestParams(HttpServletRequest request, JoinPoint joinPoint){ String httpMethod = request.getMethod(); String params = ""; if ("POST".equals(httpMethod) || "PUT".equals(httpMethod) || "PATCH".equals(httpMethod)) { Object[] paramsArray = joinPoint.getArgs(); params = argsArrayToString(paramsArray); } else { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); // 请求的方法参数值 Object[] args = joinPoint.getArgs(); // 请求的方法参数名称 LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer(); String[] paramNames = u.getParameterNames(method); if (args != null && paramNames != null) { for (int i = 0; i < args.length; i++) { params += " " + paramNames[i] + ": " + args[i]; } } } return params; }
友情提示: 未按格式要求发帖,会直接删掉。
The text was updated successfully, but these errors were encountered:
非常感谢,已收录
Sorry, something went wrong.
No branches or pull requests
版本号:
2.1.4
问题描述:
日志管理,没有记录查询接口参数
截图&代码:
AutoLogAspect.java
---------------我是这么处理的----------------------
//请求的参数
Object[] args = joinPoint.getArgs();
try{
String params = this.getReqestParams(request,joinPoint);
sysLog.setRequestParam(params);
}catch (Exception e){
友情提示: 未按格式要求发帖,会直接删掉。
The text was updated successfully, but these errors were encountered: