In AppFuse 1.9.x, I added the aop:config that you have, as well as the
performanceInterceptor bean definition. Except I didn't include the
"loggerName" property.
In log4j.properties, I added:
log4j.logger.org.springframework.aop.interceptor=DEBUG
When running "ant test-service", I get:
test-service:
[echo] Testing service...
[junit] Testsuite: org.appfuse.service.GenericManagerTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.344 sec
[junit] [appfuse] DEBUG [main]
LookupManagerTest.testGetAllRoles(24) | entered 'testGetAllRoles'
method
[junit] Testsuite: org.appfuse.service.LookupManagerTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.loadContextLocations(136) | Loading contex
t for:
classpath*:/org/appfuse/dao/applicationContext-*.xml,classpath*:/org/appfuse/service/applicat
ionContext-service.xml,classpath*:META-INF/applicationContext-*.xml
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.startNewTransaction(309) | Began transacti
on (1): transaction manager
[EMAIL PROTECTED];
default rollback = true
[junit] [appfuse] DEBUG [main]
UserExistsExceptionTest.testAddExistingUser(24) | entered 'testAd
dExistingUser' method
[junit] [appfuse] DEBUG [main]
PerformanceMonitorInterceptor.invokeUnderTrace(64) | StopWatch 'o
rg.appfuse.service.UserManager.getUser': running time (millis) = 63
[junit] [appfuse] DEBUG [main] UserDaoHibernate.saveUser(49) |
user's id: null
[junit] [appfuse] WARN [main]
JDBCExceptionReporter.logExceptions(71) | SQL Error: 1062, SQLStat
e: 23000
[junit] [appfuse] ERROR [main]
JDBCExceptionReporter.logExceptions(72) | Duplicate entry 'tomcat
' for key 2
[junit] [appfuse] DEBUG [main]
PerformanceMonitorInterceptor.invokeUnderTrace(64) | StopWatch 'o
rg.appfuse.service.UserManager.saveUser': running time (millis) = 46
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.endTransaction(275) | Rolled back transact
ion after test execution
[junit] Testsuite: org.appfuse.service.UserExistsExceptionTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 4.578 sec
[junit] [appfuse] DEBUG [main] UserManagerImpl.removeUser(67) |
removing user: 5
[junit] [appfuse] DEBUG [main]
UserManagerTest.testUserExistsException(124) | expected exception
: User 'admin' already exists!
[junit] Testsuite: org.appfuse.service.UserManagerTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.078 sec
[junit] [appfuse] DEBUG [main] UserSecurityAdvice.before(70) |
Verifying that 'user' can modify
'admin'
[junit] [appfuse] WARN [main] UserSecurityAdvice.before(73) |
Access Denied: 'user' tried to mod
ify 'admin'!
[junit] [appfuse] WARN [main] UserSecurityAdvice.before(105) |
Access Denied: 'user' tried to ch
ange their role(s)!
[junit] [appfuse] WARN [main] UserSecurityAdvice.before(105) |
Access Denied: 'user' tried to ch
ange their role(s)!
[junit] [appfuse] DEBUG [main] UserSecurityAdvice.before(70) |
Verifying that 'user' can modify
'cacheduser'
[junit] [appfuse] DEBUG [main]
UserSecurityAdvice.afterReturning(118) | Removing 'cacheduser' fr
om userCache
[junit] Testsuite: org.appfuse.service.UserSecurityAdviceTest
[junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.657 sec
[junit] Testsuite: org.appfuse.util.DateConverterTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.063 sec
[junit] Testsuite: org.appfuse.util.DateUtilTest
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.016 sec
[junit] Testsuite: org.appfuse.util.StringUtilTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.016 sec
BUILD SUCCESSFUL
Total time: 9 seconds
So it's working. If you add loggerName, you need to configure
log4j.properties as well. For example:
<bean id="performanceInterceptor"
class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor">
<property name="loggerName" value="performance"/>
</bean>
log4j.logger.performance=DEBUG
<snip>
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.loadContextLocations(136) | Loading contex
t for:
classpath*:/org/appfuse/dao/applicationContext-*.xml,classpath*:/org/appfuse/service/applicat
ionContext-service.xml,classpath*:META-INF/applicationContext-*.xml
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.startNewTransaction(309) | Began transacti
on (1): transaction manager
[EMAIL PROTECTED];
default rollback = true
[junit] [appfuse] DEBUG [main]
UserExistsExceptionTest.testAddExistingUser(24) | entered 'testAd
dExistingUser' method
[junit] [appfuse] DEBUG [main] performance.invokeUnderTrace(64) |
StopWatch 'org.appfuse.service
.UserManager.getUser': running time (millis) = 79
[junit] [appfuse] DEBUG [main] UserDaoHibernate.saveUser(49) |
user's id: null
[junit] [appfuse] WARN [main]
JDBCExceptionReporter.logExceptions(71) | SQL Error: 1062, SQLStat
e: 23000
[junit] [appfuse] ERROR [main]
JDBCExceptionReporter.logExceptions(72) | Duplicate entry 'tomcat
' for key 2
[junit] [appfuse] DEBUG [main] performance.invokeUnderTrace(64) |
StopWatch 'org.appfuse.service
.UserManager.saveUser': running time (millis) = 47
[junit] [appfuse] INFO [main]
UserExistsExceptionTest.endTransaction(275) | Rolled back transact
ion after test execution
</snip>
Hope this helps,
Matt
On 1/11/07, maskkkk <[EMAIL PROTECTED]> wrote:
I thought that's what was going on!
Keep up the good work Matt!
And thanks for all you've done already!
Matt Raible-3 wrote:
>
> I think your question was pretty clear. The reason you haven't got an
> answer is likely because no one knows the answer. ;-)
>
> Of course, I could try to reproduce it myself, but I'm working on
> AppFuse 2.x documentation today.
>
> Matt
>
> On 1/11/07, maskkkk <[EMAIL PROTECTED]> wrote:
>>
>> Have I been banned or is my question just that unclear?
>>
>> Thank you,
>> Andrew J. Leer
>>
>>
>> maskkkk wrote:
>> >
>> > I'm trying to test out a simple Interceptor:
>> > org.springframework.aop.interceptor.PerformanceMonitorInterceptor
>> >
>> > I've ruled out that it has to do with my log4j.xml since I have another
>> > class that was logging under the same logger and I recieved output.
>> What
>> > else do I need to do to get this Interceptor to log?
>> >
>> >
>> > applicationContext-service.xml - aop:config wrote:
>> >>
>> >> <aop:config>
>> >> <aop:advisor id="userManagerTx"
>> advice-ref="userManagerTxAdvice"
>> >> pointcut="execution(* *..service.UserManager.*(..))" order="0"/>
>> >> <aop:advisor id="userManagerSecurity"
>> >> advice-ref="userSecurityAdvice" pointcut="execution(*
>> >> *..service.UserManager.saveUser(..))" order="1"/>
>> >> <aop:advisor id="managerTx" advice-ref="txAdvice"
>> >> pointcut="execution(* *..service.*Manager.*(..))" order="2"/>
>> >>
>> >>
>> >> <!-- New Interceptor Test -->
>> >> <aop:advisor
>> >> advice-ref="performanceInterceptor"
>> >> id="performanceInterceptorAdvisor"
>> >> pointcut="execution(* *..service.*Manager.*(..))"
>> order="3"/>
>> >>
>> >> <!-- End Intercepter Test -->
>> >> </aop:config>
>> >>
>> >
>> >
>> > applicationContext-service.xml - Interceptor bean wrote:
>> >>
>> >> <!-- New Interceptor Test -->
>> >> <bean id="performanceInterceptor"
>> >>
>> class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor">
>> >> <property name="loggerName"
>> value="PerformanceInterceptor"/>
>> >> </bean>
>> >> <!--End New Interceptor Test-->
>> >>
>> >
>> > Thank you,
>> > Andrew J. Leer
>> >
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/Interceptor-doesn%27t-log-anything-tf2954532s2369.html#a8277942
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Interceptor-doesn%27t-log-anything-tf2954532s2369.html#a8291715
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]