欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

切入Debug日志-創(chuàng)新互聯(lián)

注意:Action如果實現(xiàn)了Action接口,或者繼承了ActionSupport類,則要在aop:config標簽添加 proxy-target-class="true",否者會拋異常。

創(chuàng)新互聯(lián)建站專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務,包含不限于網(wǎng)站設計、成都網(wǎng)站建設、靖江網(wǎng)絡推廣、小程序設計、靖江網(wǎng)絡營銷、靖江企業(yè)策劃、靖江品牌公關、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運營等,從售前售中售后,我們都將竭誠為您服務,您的肯定,是我們大的嘉獎;創(chuàng)新互聯(lián)建站為所有大學生創(chuàng)業(yè)者提供靖江建站搭建服務,24小時服務熱線:18980820575,官方網(wǎng)址:chinadenli.net

新建文件:DebugLogger.java:

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;

public class DebugLogger{

Logger logger = Logger.getLogger(DebugLogger.class);

StringBuffer buffer = new StringBuffer();

        public void log(JoinPoint joinPoint) {

        Object[] args = joinPoint.getArgs();
        buffer.delete(0, buffer.length()).append("enter function: ").append(joinPoint.getSignature()).append(", parameters: ");
        if (args != null) {
            for (Object obj : args) {
              buffer.append(obj);
            }
        }
        if (logger.isDebugEnabled())
        {
          logger.debug(buffer.toString());
        }    

  }

    public void logWithReturn(JoinPoint joinPoint, Object returnObj) {
        buffer.delete(0, buffer.length()).append("exit function:").append(joinPoint.getSignature()).append(", return value:").append(returnObj);
        if (logger.isDebugEnabled())
        {
          logger.debug(buffer.toString());
        }
    }
}

-----------------------------------------------------------默默無聞的分割線-----------------------------------------------------------

更改applicationContext.xml文件:

<bean id="debugLogger" class="com.shenzhen.management.util.log.DebugLogger"></bean>

<aop:config  proxy-target-class="true">
       <aop:pointcut id="logPointcut" expression="execution(* com.shenzhen.management.action.*.*(..))
                                              or execution(* com.shenzhen.management.service.*.*(..))
                                              or execution(* com.shenzhen.management.dao.*.*(..))"/>
      <aop:aspect id="logAspect" ref="debugLogger">
        <aop:before method="log" pointcut-ref="logPointcut"/>
        <aop:after-returning method="logWithReturn" returning="returnObj" pointcut-ref="logPointcut"/>
      </aop:aspect>
</aop:config>

創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國云服務器,動態(tài)BGP最優(yōu)骨干路由自動選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡助力業(yè)務部署。公司持有工信部辦法的idc、isp許可證, 機房獨有T級流量清洗系統(tǒng)配攻擊溯源,準確進行流量調(diào)度,確保服務器高可用性。佳節(jié)活動現(xiàn)已開啟,新人活動云服務器買多久送多久。

當前標題:切入Debug日志-創(chuàng)新互聯(lián)
轉載來源:http://chinadenli.net/article48/degjep.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、關鍵詞優(yōu)化、網(wǎng)站維護、全網(wǎng)營銷推廣建站公司、營銷型網(wǎng)站建設

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設