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
d0cb8c27
Commit
d0cb8c27
authored
Mar 13, 2025
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复异常提醒,从而正确的跟踪异常信息
parent
f8f13ba4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
UrlHelper.java
.../src/main/java/com/yanzuoguang/util/helper/UrlHelper.java
+2
-2
AspectWeb.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/AspectWeb.java
+2
-1
LogCountTime.java
...il-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
+2
-9
LogLocal.java
yzg-util-db/src/main/java/com/yanzuoguang/log/LogLocal.java
+3
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/UrlHelper.java
View file @
d0cb8c27
...
...
@@ -21,10 +21,10 @@ public class UrlHelper {
*/
public
static
String
encoding
(
String
from
,
String
encoding
)
{
try
{
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
from
.
length
();
i
++)
{
char
c
=
from
.
charAt
(
i
);
if
(
c
>=
0
&&
c
<=
255
)
{
if
(
c
<=
255
)
{
sb
.
append
(
c
);
}
else
{
String
t
=
URLEncoder
.
encode
(
""
+
c
,
encoding
);
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectWeb.java
View file @
d0cb8c27
...
...
@@ -7,6 +7,7 @@ import com.yanzuoguang.token.TokenHelper;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.TypeHelper
;
import
com.yanzuoguang.util.helper.UrlHelper
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.vo.CloudConfig
;
import
com.yanzuoguang.util.vo.ResponseResult
;
...
...
@@ -90,7 +91,7 @@ public class AspectWeb {
}
Object
requestBody
=
aspectLogBody
.
getRequestBody
(
joinPoint
);
boolean
clear
=
aspectLog
.
requestLogInit
();
LogInfoVo
log
=
aspectLog
.
start
(
declaringType
,
TAG
,
url
,
requestBody
,
clear
);
LogInfoVo
log
=
aspectLog
.
start
(
declaringType
,
TAG
,
UrlHelper
.
getPage
(
url
),
String
.
format
(
"请求地址:%s 请求内容:%s"
,
url
,
requestBody
)
,
clear
);
Exception
ex
=
null
;
boolean
isInit
=
false
;
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogCountTime.java
View file @
d0cb8c27
...
...
@@ -65,15 +65,8 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
private
LogUrlCountVo
getCount
(
String
tag
,
String
urlFrom
,
int
level
)
{
// 初始化日期
initToday
();
// 目标地址
String
urlTo
;
if
(
urlFrom
.
contains
(
URL_PARA_START
))
{
urlTo
=
urlFrom
.
substring
(
0
,
urlFrom
.
indexOf
(
URL_PARA_START
));
}
else
{
urlTo
=
urlFrom
;
}
// 关键字
String
key
=
StringHelper
.
getId
(
tag
,
url
To
,
level
);
String
key
=
StringHelper
.
getId
(
tag
,
url
From
,
level
);
// 缓存中获取对象
LogUrlCountVo
ret
=
todayMemoryCache
.
get
(
key
);
if
(
ret
!=
null
)
{
...
...
@@ -85,7 +78,7 @@ public class LogCountTime implements ThreadNext.Next, InitializingBean {
if
(
ret
!=
null
)
{
return
ret
;
}
ret
=
new
LogUrlCountVo
(
tag
,
url
To
,
level
);
ret
=
new
LogUrlCountVo
(
tag
,
url
From
,
level
);
todayMemoryCache
.
put
(
key
,
ret
);
return
ret
;
}
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogLocal.java
View file @
d0cb8c27
...
...
@@ -2,6 +2,7 @@ package com.yanzuoguang.log;
import
com.yanzuoguang.util.cache.MemoryCache
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.UrlHelper
;
import
com.yanzuoguang.util.thread.ThreadNext
;
import
com.yanzuoguang.util.vo.CloudConfig
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
@@ -78,6 +79,8 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
}
else
{
useTime
=
log
.
getUseTime
();
}
// 修复当前地址
log
.
setUrl
(
UrlHelper
.
getPage
(
log
.
getUrl
()));
// 获取当前请求的级别
int
level
=
0
;
...
...
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