Commit 941bcb5d authored by jiaorz's avatar jiaorz

日志打印

parent 4163bc45
...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.log.entity.LogEntity; ...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.log.entity.LogEntity;
import com.github.wxiaoqi.security.common.log.entity.XxLogEntity; import com.github.wxiaoqi.security.common.log.entity.XxLogEntity;
import com.github.wxiaoqi.security.common.msg.BaseResponse; import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,6 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor; ...@@ -25,6 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Service @Service
@Slf4j
public class CommonLogServiceImpl implements CommonLogService { public class CommonLogServiceImpl implements CommonLogService {
@Value("${spring.application.name}") @Value("${spring.application.name}")
...@@ -86,6 +88,7 @@ public class CommonLogServiceImpl implements CommonLogService { ...@@ -86,6 +88,7 @@ public class CommonLogServiceImpl implements CommonLogService {
} }
@Override @Override
public void run() { public void run() {
log.info("用户请求信息:xxLogEntity = {}", xxLogEntity.toString());
mongoTemplate.insert(xxLogEntity, xxLogEntity.getMongoKey()); mongoTemplate.insert(xxLogEntity, xxLogEntity.getMongoKey());
} }
} }
......
...@@ -14,13 +14,13 @@ import java.util.Date; ...@@ -14,13 +14,13 @@ import java.util.Date;
public class XxLogEntity implements Serializable { public class XxLogEntity implements Serializable {
private String app; private String app;
private String method;
private String createDate;
private String servletPath; private String servletPath;
private String requestPath;
private String requestData; private String requestData;
private String responseData; private String responseData;
private String createDate;
private String endDate; private String endDate;
private String requestPath;
private String method;
private String mongoKey; private String mongoKey;
public XxLogEntity() { public XxLogEntity() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment