5 Replies Latest reply on May 15, 2007 8:59 AM by kabirkhan

    JBoss Logging and JBoss AOP

    kabirkhan

      I'd like to integrate JBoss AOP with JBoss Logging at some stage, at least when deployed in jboss.

      The reason logging is not included is from before my time, so if somebody can tell me why integrating with JBoss Logging is a bad idea I'll think about it. If not, it's going in.

        • 1. Re: JBoss Logging and JBoss AOP
          alesj

          You can do something similar as Seam is doing.
          Transparent log injection with built-in message lookup and formating.

          • 2. Re: JBoss Logging and JBoss AOP

             

            "kabir.khan@jboss.com" wrote:

            The reason logging is not included is from before my time.


            IIRC the issue was just that users would need to include log4j when using aopc.

            • 3. Re: JBoss Logging and JBoss AOP
              starksm64

              Hopefully that is resolved with the separation of the logging spi from jdk/log4j impls.

              • 4. Re: JBoss Logging and JBoss AOP
                kabirkhan

                 

                "scott.stark@jboss.org" wrote:
                Hopefully that is resolved with the separation of the logging spi from jdk/log4j impls.


                I'm repackaging AOP for the next 2.0.alpha, and am putting in the jars for jboss logging. I am in doubt about what to ship with though. The minimum needed to run is the jboss-logging-spi.jar, which uses the NullLoggerPlugin, so there is no logging.

                In order to have any meaningful logging we would need to add jboss-logging-log4j.jar and log4j.jar. Are the any reasons why these should NOT be part of the aop download?

                This mainly applies to people running aop standalone, in the app server all the necessary bits and pieces are obviously present.

                • 5. Re: JBoss Logging and JBoss AOP
                  kabirkhan

                  I have integrated the logging stuff into AOP core. AspectManager.verbose is still the main switch for verbose logging from the AOP core classes.

                  Rather than doing:

                  Logger logger = Logger.getLogger(SomeClass.class);
                  


                  Do
                  Logger logger = AOPLogger.getLogger(SomeClass.class);
                  

                  AOPLogger is a subclass of Logger whose only function is to check if the chosen LoggerPlugin cannot be found, and if so to make sure we use a SystemOutLoggerPlugin I implemented. This prints out everything to System.out regardless of logging level.

                  So AspectManager.verbose turns on logging, and integrating with log4j allows more fine-grained control over what is logged.