Log message on Spring AOP Aspect start up

131 views Asked by At

how to log message on Spring AOP aspect start up? The only way I see is to specify flag on every intercepted method and check. May be any other options? Thanks

1

There are 1 answers

0
Jeroen van Dijk-Jun On

If you want to get that line every time a pointcut is done by Spring AOP, you could

  • pointcut all the AOP methods with a new pointcut
  • make all pointcuts extend some super-pointcut

which you target to write that line.

If you want to have the AOP class write something when it gets loaded, you can use @BeforeClass to have it do something before the class gets used.