Set Loadtime Weaving with log4j Logging
Loadtime weaving with log4j logging For this example, again, we pass in ... ... when running the application, so logging is now turned on. In this case both jboss-logging-log4j.jar and log4j.jar are on the classpath, so JBoss AOP will now use the log4j logging mechanism. To get any meaningful output, you need a log4j.properties on the classpath, with which you can get more fine-grained control of logging levels for different classes during the JBoss AOP weaving process, as well as control of the output formats etc. See the Apache log4j documentation for more information about log4j. To run the example with log4j logging, run: $ ant run.loadtime.log4j.logging Again, this will generate quite a lot of logging for each woven class during the weaving process, the most important bits show below: run.loadtime.log4j.logging: ... [java] 2007-05-15 23:38:23,625 DEBUG org.jboss.aop.instrument.Instrumentor - trying to transform POJO [java] 2007-05-15 23:38:23,625 DEBUG org.jboss.aop.instrument.CallerTransformer - There are no caller pointcuts! [java] 2007-05-15 23:38:23,625 DEBUG org.jboss.aop.instrument.JoinpointSimpleClassifier - javassist.CtMethod@ae60ead5[public notwoven ()V] matches no pointcuts [java] 2007-05-15 23:38:23,640 DEBUG org.jboss.aop.instrument.JoinpointSimpleClassifier - javassist.CtMethod@7c6e6140[public boundMethod ()V] matches pointcut: execution(public void POJO->boundMethod()) [java] 2007-05-15 23:38:24,015 DEBUG org.jboss.aop.instrument.JoinpointSimpleClassifier - javassist.CtConstructor@60991f[public POJO ()V] matches no pointcuts [java] 2007-05-15 23:38:24,015 DEBUG org.jboss.aop.instrument.Instrumentor - was POJO converted: true ... [java] --- pojo.notwoven(); --- [java] notwoven() [java] --- pojo.boundMethod(); --- ... [java] <<< Entering SimpleInterceptor [java] boundMethod [java] >>> Leaving SimpleInterceptor BUILD SUCCESSFUL Total time: 3 seconds Yet again we see that the POJO class was woven since the pointcut execution(public void POJO->boundMethod() matched our method POJO.boundMethod()