Question

We are looking at spring's AOP framework for adding Audit log functionality in our application based on Spring MVC.

In our application whenever we call a service method we pass extra audit log object (in addition to the normal method parameter). This audit log object has few properties pre populated like username, user id and user ip address etc.

In the actual service method we set few more properties on the audit log object depending on method being called or the operation being performed in the service method.

This is very dynamic and varies from method to method.

In the AOP classes we can intercept the method parameters and the return values. But what about the values which are being calculated based on the operation being performed in the service method and then set on the audit log object. This values wont be available in the AOP classes.

Basically we need to populate the audit log object and then save it in the db after execution of the method with the come parameters being set in method being intercepted only.

Is there any we can do this?

Please help.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top