I am using Perf4j to do performance logging.
It specifies that you use aop.xml to define which Aspect you want to be called at compile time depending on which logging system you are using. I cannot get it to pick up the aop.xml file which is in src/main/webapp/meta-inf/aop.xml
I cannot figure out how to get my Maven plugin to only weave the log4j aspect.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
<outxml>true</outxml>
<source>1.6</source>
<target>1.6</target>
<weaveDependencies>
<dependency>
<groupId>org.perf4j</groupId>
<artifactId>perf4j</artifactId>
</dependency>
</weaveDependencies>
<aspects>
<includes>
<include>org.perf4j.log4j.aop.TimingAspect</include>
</includes>
</aspects>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
When I package I get the following.
[INFO] --- aspectj-maven-plugin:1.3:compile (default) @ trace-web ---
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceJSONController.getResults(javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpServletRequest))' in Type 'com.idna.trace.web.controllers.TraceJSONController' (TraceJSONController.java:121) advised by around advice from 'org.perf4j.commonslog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceJSONController.getResults(javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpServletRequest))' in Type 'com.idna.trace.web.controllers.TraceJSONController' (TraceJSONController.java:121) advised by around advice from 'org.perf4j.log4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceJSONController.getResults(javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpServletRequest))' in Type 'com.idna.trace.web.controllers.TraceJSONController' (TraceJSONController.java:121) advised by around advice from 'org.perf4j.javalog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceJSONController.getResults(javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpServletRequest))' in Type 'com.idna.trace.web.controllers.TraceJSONController' (TraceJSONController.java:121) advised by around advice from 'org.perf4j.slf4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:106) advised by around advice from 'org.perf4j.commonslog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:106) advised by around advice from 'org.perf4j.log4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:106) advised by around advice from 'org.perf4j.javalog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:106) advised by around advice from 'org.perf4j.slf4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsAddressModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:282) advised by around advice from 'org.perf4j.commonslog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsAddressModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:282) advised by around advice from 'org.perf4j.log4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsAddressModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:282) advised by around advice from 'org.perf4j.javalog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsAddressModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:282) advised by around advice from 'org.perf4j.slf4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsBmdModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:419) advised by around advice from 'org.perf4j.commonslog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsBmdModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:419) advised by around advice from 'org.perf4j.log4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsBmdModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:419) advised by around advice from 'org.perf4j.javalog.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO] Join point 'method-execution(org.springframework.web.servlet.ModelAndView com.idna.trace.web.controllers.TraceHTMLController.getDetailsBmdModelAndView(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.springframework.ui.Model))' in Type 'com.idna.trace.web.controllers.TraceHTMLController' (TraceHTMLController.java:419) advised by around advice from 'org.perf4j.slf4j.aop.TimingAspect' (perf4j-0.9.13.jar!AbstractTimingAspect.class(from AbstractTimingAspect.java))
[INFO]
The answer is that Perf4J must specify log4jonly and it cannot be done in the maven plugin configuration as far as I could see.
<dependency>
<groupId>org.perf4j</groupId>
<artifactId>perf4j</artifactId>
<version>0.9.13</version>
<classifier>log4jonly</classifier>
</dependency>
The answer is that Perf4J must specify log4jonly and it cannot be done in the maven plugin configuration as far as I could see.