1 2 Previous Next 16 Replies Latest reply on Aug 22, 2006 11:50 AM by kabirkhan Go to original post
      • 15. Re: using CallLoggingInterceptor on existing web app
        cpmcda01

        This is an old post, but I'm resurrecting it because it seems it was never resolved, and I think I know why. The following code in CallLoggingInterceptor is evaluating to false:

        boolean callLogging = log.isDebugEnabled();
        if (callLogging)
         callLogging = Boolean.valueOf((String)invocation.getMetaData(LOGGING,
         CALL_LOGGING)).booleanValue();
        


        First, let me say that key configuration like this should be mentioned in the Javadoc API for this class. I spent nearly two days trying to get call logging to work and all the while I kept thinking that JBoss AOP was broken or I was doing something fundamentally wrong. I can not express how frustrated I was and how much my impression of the JBoss product diminished when I found that the source of the problem was buried in the interceptor code and was not reasonably documented.

        So I gave up and I made my own Interceptor, copy-pasting most of the code from CallLoggingInterceptor, leaving out the above. Everything is working fine. Curious as to how this meta-data stuff worked, I went to the JBoss AOP documentation and found it sorely lacking. See for yourself:
        http://labs.jboss.com/portal/jbossaop/docs/1.5.0.GA/docs/aspect-framework/reference/en/html/xml.html#xml-metadata

        How would I configure this meta-data in my -aop.xml file to get the CallLoggingInterceptor to actually log something?

        • 16. Re: using CallLoggingInterceptor on existing web app
          kabirkhan

           

          "cpmcda01" wrote:
          I can not express how frustrated I was and how much my impression of the JBoss product diminished when I found that the source of the problem was buried in the interceptor code and was not reasonably documented.


          It seems like you are doing a pretty good job to me :-)

          I've added a JIRA issue to deal with the documentation issues you mention
          http://jira.jboss.com/jira/browse/JBAOP-283

          I think the following should do the job:

          <metadata tag="logging" class="org.blah.MyClass">
           <default>
           <call-logging>true</call-logging>
           </default>
          </metadata>
          


          More flexible class expressions are supported as well, e.g
          <metadata tag="logging" class="$instanceof{@org.blah.Loggable}">
           <default>
           <call-logging>true</call-logging>
           </default>
          </metadata>
          


          Or you can narrow it down for particular fields, methods, ctors

          <metadata tag="logging" class="$instanceof{@org.blah.Loggable}">
           <method expr="void some*(..)">
           <call-logging>true</call-logging>
           </method>
           <method expr="void more*(..)">
           <call-logging>true</call-logging>
           </method>
           <field name="somefield">
           <call-logging>true</call-logging>
           </field></metadata>
          



          1 2 Previous Next