Class AbstractAopMethodLogger


  • @Component
    public abstract class AbstractAopMethodLogger
    extends Object
    Aspect: Logging method calls. Log all public service calls and all public repository calls.
    • Constructor Detail

      • AbstractAopMethodLogger

        public AbstractAopMethodLogger()
    • Method Detail

      • methodsToBeLogged

        public abstract void methodsToBeLogged()
        implement this method in your project specific Aspect, defining method patterns as Pointcuts.
      • logMethodCall

        public void logMethodCall​(org.aspectj.lang.JoinPoint joinPoint)
        Logs the execution of a join point and of its parameters. Parameters are only logged if not null.

        In aspect-oriented programming a set of join points is called a pointcut. A join point is a specification of when, in the corresponding main program, the aspect code should be executed. The join point is a point of execution in the base code where the advice specified in a corresponding pointcut is applied.

        Parameters:
        joinPoint - the event of the advice
      • logMethodDuration

        public Object logMethodDuration​(org.aspectj.lang.ProceedingJoinPoint call)
                                 throws Throwable
        Logs duration of join points. Logging is only active if LOGGER is at minimum debug level.
        Parameters:
        call - a proceeding joinpoint
        Returns:
        the next advice or target method invocation
        Throws:
        Throwable - if error in proceeding