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
Asked
Active
Viewed 129 times
1
-
Can you clarify please. Do you want to log the AOP or the method it wraps? – Essex Boy Jan 16 '17 at 09:39
-
The best case - aspect bean created, then log message about this logged. I don't want to intercept all the needed method calls and check inside whether message was logged or not. – antongarakh Jan 16 '17 at 10:31
-
I will vote for the question to be closed because it is unclear. Please edit the question, improve it by adding **code**. The code should communicate your situation and what you want to achieve. Then I will retract my vote. – kriegaex Jan 17 '17 at 22:11
1 Answers
1
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.

Jeroen van Dijk-Jun
- 1,028
- 10
- 22