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>
  • 相关阅读:
    python中unicode、utf8、gbk等编码问题
    git常用操作
    python List&Set&Dict交集、并集、差集
    VIM的高级使用
    Logger级别和输出的地方
    Eclipse+pydev 常用快捷键
    架构相关领域的学习材料(转)
    深入浅出之正则表达式(一)
    深入浅出之正则表达式(二)
    软件project总结
  • 原文地址:https://www.cnblogs.com/llcto/p/2118019.html
Copyright © 2011-2022 走看看