首页>代码>基于Spring+Spring MVC+Mybatis开发的社区论坛系统>/Genesis-master/src/main/java/com/withstars/aop/LogAspect.java
package com.withstars.aop;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: withstars
 * Date: 2018-02-22
 * Time: 20:41
 * Mail: withstars@126.com
 */
@Component
@Aspect
public class LogAspect {
     private final Log log = LogFactory.getLog(getClass());

    @Before("execution(* com.withstars.controller.UserController.signin(..))")
    public void loginLogAspect(JoinPoint joinPoint){
        String methodName=joinPoint.getSignature().toShortString();
        String args=joinPoint.getArgs().toString();
        log.info("---Before method "+methodName+" invoke, param:" +args+"---");
    }

}
最近下载更多
玖零定制问题修复  LV34 3月3日
ewan007  LV29 2月25日
2897744513  LV2 2023年12月31日
lilong007  LV20 2023年12月30日
wang123999  LV19 2023年12月5日
liuyuheng  LV17 2023年11月15日
全栈小白  LV34 2023年11月6日
Seaskye  LV14 2023年11月4日
冰糖雪里  LV3 2023年11月4日
zxc131313  LV12 2023年11月2日
最近浏览更多
暂无贡献等级
kenhomeliu  LV29 4月30日
wahaha9zz 4月29日
暂无贡献等级
只想躺着  LV1 4月17日
chirsbey2 4月17日
暂无贡献等级
saaaaaa  LV14 4月16日
mzqnxyh  LV2 4月12日
strongning  LV3 4月5日
2131234536546  LV7 3月31日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友