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
bb8ae1ad
Commit
bb8ae1ad
authored
Mar 12, 2025
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复异常提醒,从而正确的跟踪异常信息
parent
5ac74567
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
LogCountTime.java
...il-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
+7
-5
LogUrlCountVo.java
...l-db/src/main/java/com/yanzuoguang/log/LogUrlCountVo.java
+10
-1
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
View file @
bb8ae1ad
...
...
@@ -57,10 +57,12 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
/**
* 获取缓存对象
*
* @param tag 标签
* @param urlFrom 地址
* @param level 等级
* @return 缓存对象
*/
private
LogUrlCountVo
getCount
(
String
urlFrom
,
int
level
)
{
private
LogUrlCountVo
getCount
(
String
tag
,
String
urlFrom
,
int
level
)
{
// 初始化日期
initToday
();
// 目标地址
...
...
@@ -71,7 +73,7 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
urlTo
=
urlFrom
;
}
// 关键字
String
key
=
StringHelper
.
getId
(
urlTo
,
level
);
String
key
=
StringHelper
.
getId
(
tag
,
urlTo
,
level
);
// 缓存中获取对象
LogUrlCountVo
ret
=
todayMemoryCache
.
get
(
key
);
if
(
ret
!=
null
)
{
...
...
@@ -83,7 +85,7 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
if
(
ret
!=
null
)
{
return
ret
;
}
ret
=
new
LogUrlCountVo
(
urlTo
,
level
);
ret
=
new
LogUrlCountVo
(
tag
,
urlTo
,
level
);
todayMemoryCache
.
put
(
key
,
ret
);
return
ret
;
}
...
...
@@ -105,12 +107,12 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
LogInfoVo
.
Handle
hisHandle
=
log
.
getHandle
();
if
(
hisHandle
!=
null
)
{
// 当前合计对象
LogUrlCountVo
count
=
getCount
(
log
.
getUrl
(),
hisHandle
.
getLevel
());
LogUrlCountVo
count
=
getCount
(
log
.
get
Tag
(),
log
.
get
Url
(),
hisHandle
.
getLevel
());
count
.
subFinish
(
hisHandle
.
getUseTime
(),
hisHandle
.
isLog
());
}
log
.
setHandle
(
handle
);
// 当前合计对象
LogUrlCountVo
count
=
getCount
(
log
.
getUrl
(),
handle
.
getLevel
());
LogUrlCountVo
count
=
getCount
(
log
.
get
Tag
(),
log
.
get
Url
(),
handle
.
getLevel
());
count
.
addFinish
(
handle
.
getUseTime
(),
handle
.
isLog
());
}
}
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogUrlCountVo.java
View file @
bb8ae1ad
...
...
@@ -9,6 +9,7 @@ public class LogUrlCountVo {
private
final
Object
lockStart
=
new
Object
();
private
final
Object
lockFinish
=
new
Object
();
private
volatile
String
tag
;
private
volatile
String
url
;
private
volatile
int
level
;
private
volatile
int
startCount
;
...
...
@@ -19,7 +20,7 @@ public class LogUrlCountVo {
private
volatile
long
minTime
=
Long
.
MAX_VALUE
;
private
volatile
long
maxTime
;
public
LogUrlCountVo
(
String
url
,
int
level
)
{
public
LogUrlCountVo
(
String
tag
,
String
url
,
int
level
)
{
this
.
url
=
url
;
this
.
level
=
level
;
}
...
...
@@ -50,6 +51,14 @@ public class LogUrlCountVo {
}
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
;
}
public
String
getUrl
()
{
return
url
;
}
...
...
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