Package io.github.tkasozi.aspect
Class InformationLoggingAspect
java.lang.Object
io.github.tkasozi.aspect.InformationLoggingAspect
Implements AOP and persists logs via Repository.
-
Constructor Summary
ConstructorsConstructorDescriptionInformationLoggingAspect
(EventLogRepository logRepository, Long ttl) Required args Constructor. -
Method Summary
Modifier and TypeMethodDescriptionlogExecutionTimeMethod
(org.aspectj.lang.ProceedingJoinPoint proceedingJoinPoint) Supports usingTimeProfile
on methods.logExecutionTimeType
(org.aspectj.lang.ProceedingJoinPoint proceedingJoinPoint) Supports usingTimeProfile
on classes.
-
Constructor Details
-
InformationLoggingAspect
Required args Constructor.- Parameters:
logRepository
- persistence layer for Event log.ttl
- Time to live.
-
-
Method Details
-
logExecutionTimeType
public Object logExecutionTimeType(org.aspectj.lang.ProceedingJoinPoint proceedingJoinPoint) throws Throwable Supports usingTimeProfile
on classes.- Parameters:
proceedingJoinPoint
- The proceeding request.- Returns:
- The object that was timed.
- Throws:
Throwable
- Expected exception.
-
logExecutionTimeMethod
public Object logExecutionTimeMethod(org.aspectj.lang.ProceedingJoinPoint proceedingJoinPoint) throws Throwable Supports usingTimeProfile
on methods.- Parameters:
proceedingJoinPoint
- The proceeding request.- Returns:
- The object that was timed.
- Throws:
Throwable
- Expected exception.
-