Commit a33890ee authored by yanzg's avatar yanzg

修复异常提醒,从而正确的跟踪异常信息

parent beb10a57
......@@ -12,6 +12,8 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import static com.yanzuoguang.log.LogInfoVo.STATUS_WAIT;
/**
* 当前线程日志编写
*
......@@ -72,6 +74,15 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
if (log == null || StringHelper.isEmpty(log.getLogId())) {
return;
}
Timeout<LogInfoVo> timeout;
// 判断是否延时结果
boolean isMaxTime = log.getStatus() == STATUS_WAIT;
if (isMaxTime) {
timeout = cache.get(log.getLogId());
} else {
timeout = cache.remove(log.getLogId());
}
// 日志请求不记录,防止死循环递归
boolean isLog = isLog(log.getTag(), log.getUrl());
// 全路径
......@@ -80,14 +91,6 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
long time = System.currentTimeMillis() - log.getStart();
// 记录请求时间
logCountTime.finish(log);
Timeout<LogInfoVo> timeout;
// 判断是否延时结果
boolean isMaxTime = StringHelper.compare(status, MAX_TIME);
if (isMaxTime) {
timeout = cache.get(log.getLogId());
} else {
timeout = cache.remove(log.getLogId());
}
logBase.addLog(log);
}
......
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