IllegalArgumentException in CustomizableTraceInterceptor
Just want to point out a problem with the org.springframework.aop.interceptor.CustomizableTr aceInterceptor
We used it the following way:
Code:
<bean id="loggingInterceptor"
class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
<property name="enterMessage">
<value>$[targetClassShortName].$[methodName]($[arguments]) Types($[argumentTypes])</value>
</property>
</bean>
To log the values, passed into our business facade.
The problem comes in with the the $[arguments] Placeholder. Passing a String containing a dollar sign $ throws a nice
Code:
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:554)
at org.springframework.aop.interceptor.CustomizableTraceInterceptor.replacePlaceholders(CustomizableTraceInterceptor.java:321)
at org.springframework.aop.interceptor.CustomizableTraceInterceptor.invokeUnderTrace(CustomizableTraceInterceptor.java:274)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
So we throwed the arguments out of the logging.
Does anyone know about another solution? Are we doing something wrong here?
Besides this error this aop style of logging simply rocks. So easy and yet so powerful. Besides this little flaw.
question for CustomizableTraceInterceptor
I tried to follow the above example. And I tried to get exception error, I could not see degug or log message anywhere. How Can I make to get these message?
I put the following def in ApplicationContext.xml
<bean id="traceInterceptor" class="org.springframework.aop.interceptor.Customi zableTraceInterceptor">
<property name="enterMessage">
<value>$[targetClassShortName].$[methodName]($[arguments]) Types($[argumentTypes])</value>
</property>
<property name="exitMessage"><value>EXIT - {1}{2}</value></property>
<property name="exceptionMessage"><value>EXIT - {1}{2}</value></property>
</bean>
<bean id="wbxml-builder" class="org.springframework.aop.framework.ProxyFact oryBean">
<property name="proxyInterfaces"><value>xxx.r.builder.Builde r</value></property>
<property name="interceptorNames">
<list>
<value>traceInterceptor</value>
Please help me to get this log?
Thanks,
Kai