双鱼儿
2017-08-28 16:22
public void doBefore(JoinPoint joinPoint){
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
javax.servlet.http.HttpServletRequest request = attributes.getRequest();
//url
logger.info("url={}", request.getRequestURL());
//ip
logger.info("ip={}", request.getRemoteAddr());
//Method:get,post等
logger.info("method:", request.getMethod());
//类方法
logger.info("classMethod={}", joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
//params
logger.info("params={}", joinPoint.getArgs());
}
method后面没有={ },细心点噢
Spring Boot进阶之Web进阶
104039 学习 · 393 问题
相似问题