Spring.net AOP异常记入单独日志文件

< object  name ="logExceptionHandler"  type ="Spring.Aspects.Exceptions.LogExceptionHandler, Spring.Aop" >
    
< property  name ="LogName"  value ="BTSS.ExceptionLogger"   />
    
< property  name ="LogLevel"  value ="Debug" />
  
</ object >

  
< object  name ="exceptionAdvice"  type ="Spring.Aspects.Exceptions.ExceptionHandlerAdvice, Spring.Aop" >
    
< property  name ="ExceptionHandlerDictionary" >
      
< dictionary >
        
< entry  key ="log"  value-ref ="logExceptionHandler" />
      
</ dictionary >
    
</ property >
    
< property  name ="exceptionHandlers" >
      
< list >
        
< value > on exception (#e is T(System.Exception)) log 'Logging an exception thrown from method ' + #method.Name  </ value >
      
</ list >
    
</ property >
  
</ object >
< object  id ="txAttributePointcut"  type ="Spring.Aop.Support.AttributeMatchMethodPointcut, Spring.Aop" >
    
< property  name ="Attribute"  value ="Spring.Transaction.Interceptor.TransactionAttribute, Spring.Data" />
  
</ object >

  
< aop:config >

    
< aop:advisor  id ="exceptionProcessAdvisor"  order ="1"
               advice-ref
="exceptionAdvice"
               pointcut-ref
="txAttributePointcut" />
  
</ aop:config >

你可能感兴趣的:(spring)