zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    习题2-7
    习题2-6
    习题2-5
    习题2-4
    习题2-3
    作业二 分支循环结构
    2- 8
    实验三-计算圆柱体积
    实验三-计算n个圆柱体体积
    实验3-计算圆面积
  • 原文地址:https://www.cnblogs.com/llcto/p/2118019.html
Copyright © 2011-2022 走看看