Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
4e8c108f
Commit
4e8c108f
authored
Mar 11, 2025
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复异常提醒,从而正确的跟踪异常信息
parent
d9a9521a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
12 deletions
+22
-12
CloudConfig.java
...se/src/main/java/com/yanzuoguang/util/vo/CloudConfig.java
+9
-1
LogCountTime.java
...il-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
+3
-9
LogLocal.java
yzg-util-db/src/main/java/com/yanzuoguang/log/LogLocal.java
+10
-2
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/CloudConfig.java
View file @
4e8c108f
...
...
@@ -43,6 +43,11 @@ public class CloudConfig {
*/
@Value
(
"${yzg.log.time.max:[0,100,300,1000,5000,30000]}"
)
private
List
<
Integer
>
logTimeMax
=
new
ArrayList
<>();
/**
* 写入时间
*/
@Value
(
"${yzg.log.time.writeTime:1000}"
)
private
int
logWriteTime
;
/**
* 死锁时间
*/
...
...
@@ -79,7 +84,6 @@ public class CloudConfig {
@Value
(
"${yzg.gateway:^.*gateway.*$}"
)
private
String
gateWay
;
/**
* 外网地址
*/
...
...
@@ -114,6 +118,10 @@ public class CloudConfig {
return
logTimeMax
;
}
public
int
getLogWriteTime
()
{
return
logWriteTime
;
}
public
int
getLockTime
()
{
return
lockTime
;
}
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
View file @
4e8c108f
...
...
@@ -95,19 +95,13 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
/**
* 结束
*
* @param log 日志信息
* @param log 日志信息
* @param useTime 使用时间
*/
public
void
finish
(
LogInfoVo
log
)
{
public
void
finish
(
LogInfoVo
log
,
long
useTime
)
{
if
(
log
==
null
)
{
return
;
}
// 获取当前使用时间
long
useTime
;
if
(
log
.
getEnd
()
==
0
)
{
useTime
=
System
.
currentTimeMillis
()
-
log
.
getStart
();
}
else
{
useTime
=
log
.
getUseTime
();
}
// 获取当前请求的级别
int
level
=
0
;
if
(
useTime
>
cloudConfig
.
getLockTime
())
{
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogLocal.java
View file @
4e8c108f
...
...
@@ -69,11 +69,19 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
if
(!
isWait
)
{
cache
.
remove
(
log
.
getLogId
());
}
// 获取当前使用时间
long
useTime
;
if
(
log
.
getEnd
()
==
0
)
{
useTime
=
System
.
currentTimeMillis
()
-
log
.
getStart
();
}
else
{
useTime
=
log
.
getUseTime
();
}
// 记录请求时间
logCountTime
.
finish
(
log
);
logCountTime
.
finish
(
log
,
useTime
);
// 日志详情请求不记录,防止死循环递归
boolean
isLog
=
isLog
(
log
.
getTag
(),
log
.
getUrl
());
if
(
isLog
)
{
// 并判断是否达到记录的时间标准
if
(
isLog
&&
useTime
>=
this
.
cloudConfig
.
getLogWriteTime
())
{
logBase
.
addLog
(
log
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment