Commit 93fa0add authored by 赵啸非's avatar 赵啸非

修改调试日志记录

parent c47e47ff
......@@ -72,7 +72,7 @@ public class AccessMessageConsumerListener {
@RabbitHandler
public void onMessage(List<AccessLogEntity> messages) {
/* List<AccessLogEntity> collect = messages.stream().map(entity -> {
List<AccessLogEntity> collect = messages.stream().map(entity -> {
try {
// AccessLogEntity entity =null;
//entity = JSON.parseObject(message, AccessLogEntity.class);
......@@ -81,11 +81,11 @@ public class AccessMessageConsumerListener {
entity.setCreateUserId(1L);
entity.setCreateTime(new Date());
//判断 超过一定时间的请求 才记录
if (!ObjectUtils.isEmpty(entity.getDuration()) && entity.getDuration() < Constant.ACCESS_EXPIRE_TIME) {
/* if (!ObjectUtils.isEmpty(entity.getDuration()) && entity.getDuration() < Constant.ACCESS_EXPIRE_TIME) {
// log.info("Duration:{}",entity.getDuration());
return null;
}
Thread.sleep(10);
Thread.sleep(10);*/
return entity;
} catch (Exception e) {
log.info("反序列化异常", e);
......@@ -94,7 +94,7 @@ public class AccessMessageConsumerListener {
}).filter(f -> f != null).collect(Collectors.toList());
log.info("[Access onMessage][消息数量:{}]", collect.size());
accessLogService.save(collect);*/
accessLogService.save(collect);
}
......
......@@ -37,20 +37,15 @@ public class BizMessageConsumerListener {
@RabbitHandler
public void onMessage(List<BizLogEntity> messages) {
log.info("[Biz onMessage][消息数量:{}]", messages.size());
/* List<BizLogEntity> collect = messages.stream().map(entity -> {
try {
List<BizLogEntity> collect = messages.stream().map(entity -> {
// BizLogEntity entity = JSON.parseObject(new String(str, Charset.defaultCharset()), BizLogEntity.class);
entity.setLogTime(entity.getLogTime()==null?new Date():entity.getLogTime());
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
entity.setCreateUserId(1L);
entity.setCreateTime(new Date());
Thread.sleep(10);
} catch (Exception e) {
log.info("thread sleep ", e);
}
return entity;
}).filter(f -> f != null).collect(Collectors.toList());
bizLogService.save(collect);*/
bizLogService.save(collect);
}
}
......@@ -65,9 +65,7 @@ public class ErrorMessageConsumerListener {
} else {
errorLogService.save(entity);
}*/
// errorLogService.save(entity);
errorLogService.save(entity);
}).count();
}
}
......@@ -55,7 +55,7 @@ public class OperateMessageConsumerListener {
@RabbitHandler
public void onMessage(List<OperateLogEntity> messages) {
log.info("[Oper onMessage][消息数量:{}]", messages.size());
/* List<OperateLogEntity> collect = messages.stream().map(entity -> {
List<OperateLogEntity> collect = messages.stream().map(entity -> {
//OperateLogEntity entity = JSON.parseObject(new String(str), OperateLogEntity.class);
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
......@@ -63,6 +63,6 @@ public class OperateMessageConsumerListener {
entity.setCreateTime(new Date());
return entity;
}).collect(Collectors.toList());
operateLogService.save(collect);*/
operateLogService.save(collect);
}
}
......@@ -58,7 +58,7 @@ spring:
# 连接池中最大连接数
maxActive: 50
# 连接池中最小空闲连接数
minIdle: 10
minIdle: 5
maxWait: 3000
validationQuery: SELECT 1
validationQueryTimeout: 1000
......
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