karsten
Jul 19th, 2005, 03:21 AM
Just want to point out a problem with the org.springframework.aop.interceptor.CustomizableTr aceInterceptor
We used it the following way:
<bean id="loggingInterceptor"
class="org.springframework.aop.interceptor.CustomizableTr aceInterceptor">
<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
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher. java:554)
at org.springframework.aop.interceptor.CustomizableTr aceInterceptor.replacePlaceholders(CustomizableTra ceInterceptor.java:321)
at org.springframework.aop.interceptor.CustomizableTr aceInterceptor.invokeUnderTrace(CustomizableTraceI nterceptor.java:274)
at org.springframework.aop.interceptor.AbstractTraceI nterceptor.invoke(AbstractTraceInterceptor.java:77 )
at org.springframework.aop.framework.ReflectiveMethod Invocation.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.
We used it the following way:
<bean id="loggingInterceptor"
class="org.springframework.aop.interceptor.CustomizableTr aceInterceptor">
<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
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher. java:554)
at org.springframework.aop.interceptor.CustomizableTr aceInterceptor.replacePlaceholders(CustomizableTra ceInterceptor.java:321)
at org.springframework.aop.interceptor.CustomizableTr aceInterceptor.invokeUnderTrace(CustomizableTraceI nterceptor.java:274)
at org.springframework.aop.interceptor.AbstractTraceI nterceptor.invoke(AbstractTraceInterceptor.java:77 )
at org.springframework.aop.framework.ReflectiveMethod Invocation.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.