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
bed62e59
Commit
bed62e59
authored
Mar 22, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
68166749
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+9
-1
FeignAspect.java
.../src/main/java/com/yanzuoguang/cloud/aop/FeignAspect.java
+1
-1
MqAspect.java
...oud/src/main/java/com/yanzuoguang/cloud/aop/MqAspect.java
+1
-1
WebAspect.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
+1
-1
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
View file @
bed62e59
...
...
@@ -183,6 +183,10 @@ public class BaseRequestAspect {
return
start
;
}
protected
void
writeLogBody
(
LogVo
log
,
String
requestBody
)
{
}
/**
* 保存日志
*
...
...
@@ -191,12 +195,16 @@ public class BaseRequestAspect {
* @param url
* @param logFlag
* @param start
* @param requestBody
* @param result
* @param resultEx
* @param log
*/
protected
void
responseLog
(
Class
<?>
cls
,
String
tag
,
String
url
,
boolean
logFlag
,
long
start
,
Object
result
,
Exception
resultEx
,
LogVo
log
)
{
protected
void
responseLog
(
Class
<?>
cls
,
String
tag
,
String
url
,
boolean
logFlag
,
long
start
,
String
requestBody
,
Object
result
,
Exception
resultEx
,
LogVo
log
)
{
try
{
log
.
setContent
(
requestBody
);
long
time
=
System
.
currentTimeMillis
()
-
start
;
boolean
isLogDisplay
=
(
logFlag
&&
logCommon
)
||
resultEx
!=
null
;
boolean
isLogDatabase
=
log
!=
null
||
resultEx
!=
null
;
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/FeignAspect.java
View file @
bed62e59
...
...
@@ -67,7 +67,7 @@ public class FeignAspect extends BaseRequestAspect {
ex
=
e
;
throw
e
;
}
finally
{
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
result
,
ex
,
log
);
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
getRequestBody
(
joinPoint
),
result
,
ex
,
log
);
}
}
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/MqAspect.java
View file @
bed62e59
...
...
@@ -62,7 +62,7 @@ public class MqAspect extends BaseRequestAspect {
ex
=
e
;
throw
e
;
}
finally
{
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
result
,
ex
,
log
);
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
getRequestBody
(
joinPoint
),
result
,
ex
,
log
);
}
}
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
View file @
bed62e59
...
...
@@ -120,7 +120,7 @@ public class WebAspect extends BaseRequestAspect {
if
(
isInit
)
{
TokenHelper
.
remove
();
}
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
result
,
ex
,
log
);
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
getRequestBody
(
joinPoint
),
result
,
ex
,
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