Vish
Vish

Reputation: 879

Spring AOP Aspect Annotation Logging

we are using Spring AOP for logging the application code.but i am not able to log the controller servlet or any domain object we are using a factory class and we are able to log the method of classes instantiated from this factory class

i have tried using component tag on the domain object or servlet,but still i am not able to solve the problem

can anyone provide solution for this problem

Upvotes: 0

Views: 1407

Answers (2)

Prabhu Anbu
Prabhu Anbu

Reputation: 51

Add <aop:aspectj-autoproxy/> to your spring servlet config file.

Upvotes: 1

Ralph
Ralph

Reputation: 120871

The Compnent Annotation will not work, because the Instance is not Spring Manged if it is created by a normal new statement.

You could try to use the @Configurable annotation. But in my personal opinion, using AspectJ instead of Spring AOP would be the better solution, and AspectJ works on every object, not only on Spring Manged once..

Upvotes: 2

Related Questions