I am trying to create a wrapper for a bean that will log every time a method is called on the class. This is straight from the reference documentation. I have written an interceptor that prints the "before" and "after" log statements as in the documentation. However I have run into one problem. The class in documentation logs as follows:
System.out.println("Before: invocation=[" + invocation + "]");
I do not want to call invocatiaon.toString() but use my specific format. I want to log as <packagename>.<classname>.<methodname> ENTRY.
However to do this, I need to get hold of the target class name. But there seems to be no way to get to it. Any ideas?
Should the class have a getTarget() method in the org.springframework.aop.framework.ReflectiveMethod Invocation class?