Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.mattrixwv.cipherstream.aspect;
|
||||
|
||||
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Configuration
|
||||
public class CipherStreamLoggingAspect{
|
||||
public static final String CIPHER_NAME_LOGGING = "cipher";
|
||||
|
||||
|
||||
@Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.PutMapping) || @annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.DeleteMapping)")
|
||||
public void mappedFunction(){
|
||||
//Intentionally blank
|
||||
}
|
||||
|
||||
@Pointcut("execution(* com.mattrixwv.cipherstream.controller..*(..))")
|
||||
public void cipherMethod(){
|
||||
//Intentionally blank
|
||||
}
|
||||
|
||||
@AfterReturning(pointcut = "cipherMethod() && mappedFunction()", returning = "returnedJson")
|
||||
public void getCipherInfo(ObjectNode returnedJson){
|
||||
//Print a log
|
||||
log.info("CipherStream log {}", returnedJson);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user