Change log level
This commit is contained in:
parent
a61328e328
commit
ff272d2dde
@ -28,13 +28,13 @@ public class LoggingAspect {
|
|||||||
public void logBefore(JoinPoint joinPoint) {
|
public void logBefore(JoinPoint joinPoint) {
|
||||||
Object[] args = joinPoint.getArgs();
|
Object[] args = joinPoint.getArgs();
|
||||||
String methodName = joinPoint.getSignature().getName();
|
String methodName = joinPoint.getSignature().getName();
|
||||||
logger.info(">> {}() - {}", methodName, Arrays.toString(args));
|
logger.debug(">> {}() - {}", methodName, Arrays.toString(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterReturning(value = "publicMethodsFromLoggingPackage()", returning = "result")
|
@AfterReturning(value = "publicMethodsFromLoggingPackage()", returning = "result")
|
||||||
public void logAfter(JoinPoint joinPoint, Object result) {
|
public void logAfter(JoinPoint joinPoint, Object result) {
|
||||||
String methodName = joinPoint.getSignature().getName();
|
String methodName = joinPoint.getSignature().getName();
|
||||||
logger.info("<< {}() - {}", methodName, result);
|
logger.debug("<< {}() - {}", methodName, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterThrowing(pointcut = "publicMethodsFromLoggingPackage()", throwing = "exception")
|
@AfterThrowing(pointcut = "publicMethodsFromLoggingPackage()", throwing = "exception")
|
||||||
@ -47,9 +47,9 @@ public class LoggingAspect {
|
|||||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
Object[] args = joinPoint.getArgs();
|
Object[] args = joinPoint.getArgs();
|
||||||
String methodName = joinPoint.getSignature().getName();
|
String methodName = joinPoint.getSignature().getName();
|
||||||
logger.info(">> {}() - {}", methodName, Arrays.toString(args));
|
logger.debug(">> {}() - {}", methodName, Arrays.toString(args));
|
||||||
Object result = joinPoint.proceed();
|
Object result = joinPoint.proceed();
|
||||||
logger.info("<< {}() - {}", methodName, result);
|
logger.debug("<< {}() - {}", methodName, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user