From ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 05 九月 2024 17:05:55 +0800 Subject: [PATCH] 风行网页版爬虫 --- src/main/java/com/yeshi/buwan/aspect/LogAspect.java | 21 ++++++--------------- 1 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/aspect/LogAspect.java b/src/main/java/com/yeshi/buwan/aspect/LogAspect.java index e49f3a5..e10fc1a 100644 --- a/src/main/java/com/yeshi/buwan/aspect/LogAspect.java +++ b/src/main/java/com/yeshi/buwan/aspect/LogAspect.java @@ -1,30 +1,21 @@ package com.yeshi.buwan.aspect; -import java.lang.reflect.Method; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - +import com.yeshi.buwan.log.LogHelper; import net.sf.ehcache.CacheManager; - import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; -import org.springframework.web.context.request.ServletWebRequest; -import com.yeshi.buwan.domain.AdminInfo; -import com.yeshi.buwan.log.LogHelper; -import com.yeshi.buwan.util.Constant; -import com.yeshi.buwan.util.IPUtil; +import java.lang.reflect.Method; @Component @Aspect() public class LogAspect { - + private final Logger logger = LoggerFactory.getLogger(LogAspect.class); private String getMethodName(ProceedingJoinPoint pjp) { try { @@ -45,7 +36,7 @@ try { obj = joinPoint.proceed(args); } catch (Throwable e) { - e.printStackTrace(); + logger.error("瀹㈡埛绔帴鍙h闂嚭閿欙細", e); } LogHelper.countTime(getMethodName(joinPoint) + "#" + (System.currentTimeMillis() - starttime) + ""); return obj; -- Gitblit v1.8.0