|
@@ -33,6 +33,9 @@ public class AopLogConfiguration {
|
|
public void methodBefore(JoinPoint joinPoint){
|
|
public void methodBefore(JoinPoint joinPoint){
|
|
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
|
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
|
HttpServletRequest request = requestAttributes.getRequest();
|
|
HttpServletRequest request = requestAttributes.getRequest();
|
|
|
|
+ if(request.getRequestURL().toString().contains("/imageProcessing")){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//打印请求内容
|
|
//打印请求内容
|
|
log.info("---------------请求内容---------------");
|
|
log.info("---------------请求内容---------------");
|
|
log.info("请求地址:"+request.getRequestURL().toString());
|
|
log.info("请求地址:"+request.getRequestURL().toString());
|
|
@@ -47,6 +50,11 @@ public class AopLogConfiguration {
|
|
*/
|
|
*/
|
|
@AfterReturning(returning = "o",pointcut = "logPointcut()")
|
|
@AfterReturning(returning = "o",pointcut = "logPointcut()")
|
|
public void methodAfterReturning(Object o){
|
|
public void methodAfterReturning(Object o){
|
|
|
|
+ ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
|
|
|
+ HttpServletRequest request = requestAttributes.getRequest();
|
|
|
|
+ if(request.getRequestURL().toString().contains("/imageProcessing")){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
log.info("===============返回内容===============");
|
|
log.info("===============返回内容===============");
|
|
log.info("返回的内容:"+ o.toString());
|
|
log.info("返回的内容:"+ o.toString());
|
|
log.info("===============返回内容===============");
|
|
log.info("===============返回内容===============");
|
|
@@ -57,8 +65,12 @@ public class AopLogConfiguration {
|
|
*/
|
|
*/
|
|
@AfterThrowing(pointcut = "logPointcut()",throwing = "e")
|
|
@AfterThrowing(pointcut = "logPointcut()",throwing = "e")
|
|
public void logThrowing(JoinPoint joinPoint,Throwable e){
|
|
public void logThrowing(JoinPoint joinPoint,Throwable e){
|
|
|
|
+ ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
|
|
|
+ HttpServletRequest request = requestAttributes.getRequest();
|
|
|
|
+ if(request.getRequestURL().toString().contains("/imageProcessing")){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
log.info("***************抛出异常***************");
|
|
log.info("***************抛出异常***************");
|
|
-
|
|
|
|
log.info("请求类方法:"+joinPoint.getSignature().getName());
|
|
log.info("请求类方法:"+joinPoint.getSignature().getName());
|
|
log.info("异常内容:"+e);
|
|
log.info("异常内容:"+e);
|
|
log.info("***************抛出异常***************");
|
|
log.info("***************抛出异常***************");
|