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)-数据同步
    面试常见问题-SQL
    4TH PROFILE SOURCE IN SHAREPOINT 2013′S PEOPLE PICKER
    InfoPath代码切换视图
    Winform 的小技巧
    Sharepoint Workflow模板激活
    Hadoop介绍
    InfoPath的常见处理办法
    InfoPath的常见问题---连接外部数据源提示
    flask表单操作
  • 原文地址:https://www.cnblogs.com/llcto/p/2118019.html
Copyright © 2011-2022 走看看