2 Replies Latest reply on Feb 26, 2009 5:37 AM by stalep

    AOP Logging Tutorial

    nizzy

      Hi All,

      I'm investigating using AOP for integrating a Logging Module (ear file) into an existing J2EE application, can anyone point me to a tutorial for logging, since this is one of the classic uses for AOP!!

        • 1. Re: AOP Logging Tutorial
          nizzy

          I'm also interested in using it for unit testing!

          • 2. Re: AOP Logging Tutorial
            stalep

            hi, we dont have any logging tutorial afaik, but the examples thats included in the distro should give you a nice idea on how it can be done.
            eg take a look at JBOSS_DISTRO/docs/aspect-framework/examples/method-execution. its a simple example that show how you intercept a method. the same idea applies to logging. if you want to to change the logging of aop take a look at JBOSS_DISTRO/docs/aspect-framework/examples/logging.

            regarding testing it is kinda difficult to understand what you mean, but a nice intro for using aop with tests can be found here: http://www.jboss.org/jbossaop/docs/2.0.0.GA/docs/aspect-framework/userguide/en/html/testing.html in section 8.2. - its a bit outdated, but it will give you an idea of what can be done.