Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 589 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 589 Bytes

spring-aspectj-log-annotation

This project demonstrates how to create a @LogInfo annotation which you can use as a kind of sensor over a method.

Example :

@LogInfo("'Calling test method with ' + #input1 + ' and ' + #input2 ")
public void testMethodWithAnnotation(String input1, String input2) {
   // do stuff
}

The mechanism is based on spring and aspectj, so it can't be used on private methods.

The annotation value is in SpEL, so you can use computations, accessors, etc.

Example :

@LogInfo("'Calling test method with ' + #entity.code ")