Class LoggingInterceptor

  • All Implemented Interfaces:
    org.aopalliance.aop.Advice, org.springframework.aop.AfterAdvice, org.springframework.aop.AfterReturningAdvice, org.springframework.aop.BeforeAdvice, org.springframework.aop.MethodBeforeAdvice, org.springframework.aop.ThrowsAdvice

    public class LoggingInterceptor
    extends Object
    implements org.springframework.aop.MethodBeforeAdvice, org.springframework.aop.AfterReturningAdvice, org.springframework.aop.ThrowsAdvice
    Logger that uses AOP to log debugging information.

    Do not use this in production! It logs passwords in plain text!

    Author:
    mlowery
    • Constructor Detail

      • LoggingInterceptor

        public LoggingInterceptor()
    • Method Detail

      • before

        public void before​(Method method,
                           Object[] args,
                           Object target)
                    throws Throwable
        Specified by:
        before in interface org.springframework.aop.MethodBeforeAdvice
        Throws:
        Throwable
      • afterReturning

        public void afterReturning​(Object returnValue,
                                   Method method,
                                   Object[] args,
                                   Object target)
                            throws Throwable
        Specified by:
        afterReturning in interface org.springframework.aop.AfterReturningAdvice
        Throws:
        Throwable
      • toString

        protected String toString​(Object object)
        Returns a string representation of the given object. This is useful when third-party objects do not have toString() implementations that meet your needs.
      • arrayToString

        protected String arrayToString​(Object[] objects)
        Returns a string representation of the given array. Instead of overriding this method, try overriding toString(object) instead.