com.datastax.data.exploration.config.ControllerLogger Maven / Gradle / Ivy
The newest version!
package com.datastax.data.exploration.config;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
import java.util.Arrays;
/**
* @author charles create on 12/28/17
*/
@Aspect
@Component
public class ControllerLogger {
private static final Logger logger = LogManager.getLogger(ControllerLogger.class);
@Pointcut("@annotation(com.datastax.data.exploration.annotation.ControllerLogger)")
public void controllerAspect(){
}
@Before("controllerAspect()")
public void before(JoinPoint joinPoint){
String methodName = joinPoint.getSignature().getName();
Object[] args = joinPoint.getArgs();
logger.info(methodName+": "+ Arrays.toString(args));
}
}