MethodInterceptor implementation that allows for highly customizable
method-level tracing, using placeholders.
Trace messages are written on method entry, and if the method invocation succeeds
on method exit. If an invocation results in an exception, then an exception message
is written. The contents of these trace messages is fully customizable and special
placeholders are available to allow you to include runtime information in your log
messages. The placeholders available are:
$[methodName] - replaced with the name of the method being invoked
$[targetClassName] - replaced with the name of the class that is
the target of the invocation
$[targetClassShortName] - replaced with the short name of the class
that is the target of the invocation
$[returnValue] - replaced with the value returned by the invocation
$[argumentTypes] - replaced with a comma-separated list of the
short class names of the method arguments
$[arguments] - replaced with a comma-separated list of the
String representation of the method arguments
$[exception] - replaced with the String representation
of any Throwable raised during the invocation
$[invocationTime] - replaced with the time, in milliseconds,
taken by the method invocation
There are restrictions on which placeholders can be used in which messages:
see the individual message properties for details on the valid placeholders.
Writes a log message before the invocation based on the value of enterMessage.
If the invocation succeeds, then a log message is written on exit based on the value
exitMessage. If an exception occurs during invocation, then a message is
written based on the value of exceptionMessage.