Commit fbe49235 authored by 徐小光's avatar 徐小光

Merge branch 'optimize/sonar' into 'master'

删除日志中多余的methodName,修改queryLog这个包名



See merge request !9
parents 2c5bbbea 5d3b53d5
...@@ -40,26 +40,12 @@ public class LogCallHttpAspect { ...@@ -40,26 +40,12 @@ public class LogCallHttpAspect {
try { try {
HttpServletRequest request = attrs.getRequest(); HttpServletRequest request = attrs.getRequest();
String remoteIP = IPUtil.getRemoteIP(request); String remoteIP = IPUtil.getRemoteIP(request);
this.asyncRecordIt(pjp, result, remoteIP); Object[] args = pjp.getArgs();
LOGGER.info("http api is called,from IP:[{}],args:[{}]", remoteIP, args);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("打印http请求日志出错", e); LOGGER.error("打印http请求日志出错", e);
} }
} }
return result; return result;
} }
/**
* 异步记录日志
*
* @param pjp
* @param result
* @param remoteIP
*/
private void asyncRecordIt(ProceedingJoinPoint pjp, Object result, String remoteIP) {
Object[] args = pjp.getArgs();
String methodName = pjp.getSignature().getName();
String targetName = pjp.getTarget().getClass().getName();
LOGGER.info("http api is called,from IP:[{}],method :[{}],args:[{}]", remoteIP, targetName.concat(".").concat(methodName), args);
}
} }
/**
* 这个包是给运营系统之类的准备的.
*/
package cn.quantgroup.xyqb.controller.external.backend;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment