• springlog记录


    在servlet.xml加入 

    <aop:aspectj-autoproxy proxy-target-class="true"></aop:aspectj-autoproxy>

    sysLogAspectJ 

    package com.pandy.core.aop;

    import org.aspectj.lang.ProceedingJoinPoint;
    import org.aspectj.lang.annotation.Around;
    import org.aspectj.lang.annotation.Aspect;
    import org.aspectj.lang.annotation.Pointcut;
    import org.springframework.stereotype.Component;

    /**
    * 项目名称: wp_idea_linux
    * 功能说明: 在servlet.xml配置: <aop:aspectj-autoproxy proxy-target-class="true" />
    * 创建者: Pandy,
    * 邮箱: panyongzheng@163.com, 1453261799@qq.com
    * 版权:
    * 官网:
    * 创建日期: 15-11-13.
    * 创建时间: 下午9:42.
    * 修改历史:
    * -----------------------------------------------
    */
    @Aspect
    @Component
    public class ControllerLogAspect {

    @Pointcut("within(@org.springframework.stereotype.Controller *)")
    public void cutController(){
    }

    @Around("cutController()")
    public Object recordSysLog(ProceedingJoinPoint point) throws Throwable{
    System.out.println("=================================ControllerLogAspect执行方法2");
    return point.proceed();
    }
    }

     拦截Service等 
    在applicationContext.xml(扫描service的类的配置文件)加入 

    <aop:aspectj-autoproxy proxy-target-class="true"></aop:aspectj-autoproxy

    package com.pandy.core.aop;

    import org.aspectj.lang.ProceedingJoinPoint;
    import org.aspectj.lang.annotation.Around;
    import org.aspectj.lang.annotation.Aspect;
    import org.aspectj.lang.annotation.Pointcut;
    import org.springframework.stereotype.Component;

    /**
    * 项目名称: wp_idea_linux
    * 功能说明: 在applicationContext.xml(扫描service的配置文件)配置: <aop:aspectj-autoproxy proxy-target-class="true" />
    * 创建者: Pandy,
    * 邮箱: panyongzheng@163.com, 1453261799@qq.com
    * 版权:
    * 官网:
    * 创建日期: 15-11-13.
    * 创建时间: 下午9:42.
    * 修改历史:
    * -----------------------------------------------
    */
    @Aspect
    @Component
    public class ServiceLogAspect {

    @Pointcut("within(@org.springframework.stereotype.Service *)")
    public void cutService(){
    }

    @Around("cutService()")
    public Object recordSysLog(ProceedingJoinPoint point) throws Throwable{
    System.out.println("=================================ServiceLogAspect执行方法2");
    return point.proceed();
    }
    }

    spring log

     http://blog.csdn.net/csh624366188/article/details/7651702/

    http://blog.csdn.net/jiankunking/article/details/52244517

    http://skyfar666.iteye.com/blog/2008716 

  • 相关阅读:
    openpyxl模块介绍 ——读取excel表格
    openpyxl模块介绍 ——创建excel表格 ——并写入数据
    csv文件——读和遍历csv文件
    openpyxl模块介绍 ——原有excel表格中创建sheet ——并写入数据
    遍历目录
    c# 反转,新手看
    缩写
    对象、类和结构
    c# Outlook 收发邮件
    C#中接口的作用
  • 原文地址:https://www.cnblogs.com/wcLT/p/7830954.html
Copyright © 2020-2023  润新知