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>
  • 相关阅读:
    GIT DIFF生成.PATCH文件
    C++中static关键字作用总结
    模版与泛型编程
    模版以及全特化,偏特化
    重载运算与类型转换
    GDB调试工具(待整理)
    面向对象(primer)
    7种获取高度的区别
    把页面主体内容限定在安全区内
    ios浏览器下载,apple-itunes-app
  • 原文地址:https://www.cnblogs.com/llcto/p/2118019.html
Copyright © 2011-2022 走看看