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
8fc8b29d
Commit
8fc8b29d
authored
Mar 18, 2025
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复异常提醒,从而正确的跟踪异常信息
parent
808565c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
AspectFeign.java
.../src/main/java/com/yanzuoguang/cloud/aop/AspectFeign.java
+6
-2
AspectWeb.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/AspectWeb.java
+4
-1
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectFeign.java
View file @
8fc8b29d
...
...
@@ -5,6 +5,7 @@ import com.yanzuoguang.log.LogInfoVo;
import
com.yanzuoguang.log.LogString
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
...
...
@@ -55,10 +56,13 @@ public class AspectFeign {
public
Object
requestFeignAround
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Class
<?>
declaringType
=
joinPoint
.
getSignature
().
getDeclaringType
();
AspectLogUrl
.
WebUrlInfo
webMethodUrl
=
aspectLogUrl
.
getWebMethodBaseUrl
(
joinPoint
);
Object
requestBody
=
aspectLogBody
.
getRequestBody
(
joinPoint
);
boolean
clear
=
aspectLog
.
requestLogInit
();
String
bodyString
=
String
.
format
(
"地址:%s 内容:%s"
,
webMethodUrl
.
getRequestUrl
(),
logString
.
getBodyString
(
requestBody
));
Object
requestBody
=
aspectLogBody
.
getRequestBody
(
joinPoint
);
String
bodyStringFrom
=
logString
.
getBodyString
(
requestBody
);
String
bodyString
=
StringHelper
.
compare
(
webMethodUrl
.
getRequestUrl
(),
webMethodUrl
.
getConfigUrl
())
?
bodyStringFrom
:
String
.
format
(
"地址:%s 内容:%s"
,
webMethodUrl
.
getRequestUrl
(),
bodyStringFrom
);
LogInfoVo
log
=
aspectLog
.
start
(
declaringType
,
TAG
,
webMethodUrl
.
getConfigUrl
(),
bodyString
,
clear
);
Object
result
=
null
;
Exception
ex
=
null
;
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectWeb.java
View file @
8fc8b29d
...
...
@@ -7,6 +7,7 @@ import com.yanzuoguang.log.LogString;
import
com.yanzuoguang.token.TokenHelper
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.TypeHelper
;
import
com.yanzuoguang.util.helper.UrlHelper
;
import
com.yanzuoguang.util.log.Log
;
...
...
@@ -96,7 +97,9 @@ public class AspectWeb {
boolean
clear
=
aspectLog
.
requestLogInit
();
Object
requestBody
=
aspectLogBody
.
getRequestBody
(
joinPoint
);
String
bodyString
=
String
.
format
(
"地址:%s 内容:%s"
,
webMethodUrl
.
getRequestUrl
(),
logString
.
getBodyString
(
requestBody
));
String
bodyStringFrom
=
logString
.
getBodyString
(
requestBody
);
String
bodyString
=
StringHelper
.
compare
(
webMethodUrl
.
getRequestUrl
(),
webMethodUrl
.
getConfigUrl
())
?
bodyStringFrom
:
String
.
format
(
"地址:%s 内容:%s"
,
webMethodUrl
.
getRequestUrl
(),
bodyStringFrom
);
LogInfoVo
log
=
aspectLog
.
start
(
declaringType
,
TAG
,
UrlHelper
.
getPage
(
webMethodUrl
.
getConfigUrl
()),
bodyString
,
clear
);
Exception
ex
=
null
;
...
...
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