Lets say I am using some existing java library, and I only got .class files. But not getting the result I am expecting. So I look at the source code, and see that there is some logic there, and want to see if my correct values reach the library code.
Can I log the values that reach the .class files somehow? Was thinking of AOP..?
Method from external library.
public void updateValues(String value, MyClass classValue)
For example I see this line in source code, and when this is ran, I want to intercept it, by like writing the value and classValue to log file.
Well if you have the source code so why just don’t debug it?
But anyway – it is possible using
AOP. You need to have that.jarfile in your classpath. Lets say that you have already configured yourAOP, then all you need to do is:This pointcut will allow you to log the values of the
updateValuesmethod.