Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


Cannot get logging on services

  • I am going through all the steps of the configuration of Beet. Most of it is working, except for some issues already mentioned in the forum. The next thing that does not work for me is configuring logging over services. The controllers do work, but the other classes not. The following lines show my configuration:
        <bt:manager application="your-scrum"
                    track-method-expression="execution(* org.yourscrum.service.*.*(..)) || execution(* org.yourscrum.web.story.*.*(..))"
                    flush-schedule="0/30 * * * * ?">
            <bt:xml-persister binary="true" compress="true" file="${log.dir}/beet-yourscrum-perf.xml"/>
            <bt:http-requests parameters="dispatch"/>

    If you want to have a better look at source code, you can access it online:

    Hope someone can help, I like the framework but cannot use it very effectively right now for my project.

    Thanks, Jettro

    • Jason Trump
      Jason Trump

      hi jettro,

      off the cuff, the pointcut expression looks a little odd.  for example, i think

        execution(* org.yourscrum.service.*.*(..))

      should be simplified to

        execution(* org.yourscrum.service..*(..))

      and similarly for the other part.  personally I have found the pointcut language to be very hard to use, but it seemed more powerful than other configuration alternatives.

      if that doesn't fix the problem, can you provide a little more information: 

      1.  is the log file "beet-yourscrum-perf" being created in the expected location?
      2.  are http-request events being logged correctly?
      3.  what is your operating environment (what OS, application server, JDK version)?
      4.  are any java methods being logged at all?
      5.  are there any errors in the appserver logs?

      i have a little other work to do this weekend, but i'll try to build your-scrum and see if i can diagnose the problem.

      good luck,

      • Thanks for your response Jason. I tried multiple pointcut expressions, using intellij I can verify them. Most of the time I use this one:
        execution(* org.yourscrum.service.*Service.*(..))

        As answers to your questions:
        1. Yes the log file is created
        2. Yes the http-requests are being logged
        3. JDK 6, Mac OS X Snow leopard, Tomcat 6 (Spring 3 M4)
        4. Yes I did manage to get methods in the COntrollers being called
        5 Nope, no errors

        I do know the services are behind a transaction and they implement an interface while the controllers are annotation driven (using spring configuration.

    • Hi,
      I found my problem. It would be nice if we could make a change though. Let me try to explain.

      In my web.xml I configure the web context as well as a listener. They both create a context, but they can only exchange beans. The pointcuts are enforced on the beans prior to sharing. Therefore the pointcut as configured in the web context does not work on the beans in the other context.

      The best way would be to create one manager in the application context and make references to that manager bean. This is perfectly possible except for the http-request listener. Is it an idea to make it possible to configure this with a reference to the manager bean?

      <bt:http-requests parameters="dispatch"  tracking-manager="defaultTrackingManager"/>

      I hope it makes sence.

      • Jason Trump
        Jason Trump

        i think i do understand.  looking at your code, you would like to configure something like this:

        applicationContext.xml (loaded by ContextLoaderListener):
           <bt:manager ... />

        dispatcher-servlet.xml (loaded by DispatcherServlet):
           <bt:http-requests ... />   <!-- references bt:manager found in the other context -->

        is that right?  this is an important use case for webmvc users, we should definitely support it.  i'll see if i can write an integration test case for it.  thanks for the report.