Just want to point out a problem with the org.springframework.aop.interceptor.CustomizableTr aceInterceptor
We used it the following way:
To log the values, passed into our business facade.Code:<bean id="loggingInterceptor" class="org.springframework.aop.interceptor.CustomizableTraceInterceptor"> <property name="enterMessage"> <value>$[targetClassShortName].$[methodName]($[arguments]) Types($[argumentTypes])</value> </property> </bean>
The problem comes in with the the $[arguments] Placeholder. Passing a String containing a dollar sign $ throws a nice
So we throwed the arguments out of the logging.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)
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.


Reply With Quote