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
68166749
Commit
68166749
authored
Mar 22, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
93255d30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
FeignAspect.java
.../src/main/java/com/yanzuoguang/cloud/aop/FeignAspect.java
+7
-11
MqAspect.java
...oud/src/main/java/com/yanzuoguang/cloud/aop/MqAspect.java
+8
-11
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/FeignAspect.java
View file @
68166749
...
...
@@ -3,7 +3,6 @@ package com.yanzuoguang.cloud.aop;
import
com.yanzuoguang.util.contants.ResultConstants
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.vo.LogVo
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.aspectj.lang.ProceedingJoinPoint
;
...
...
@@ -38,16 +37,13 @@ public class FeignAspect extends BaseRequestAspect {
*/
@Around
(
value
=
"feignAspect()"
)
public
Object
requestFeignAround
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
LogVo
log
=
null
;
boolean
clear
=
requestLogInit
();
long
start
=
System
.
currentTimeMillis
();
Class
declaringType
=
joinPoint
.
getSignature
().
getDeclaringType
();
String
url
=
getMethodUrl
(
joinPoint
);
log
=
startLog
(
TAG
,
url
,
getRequestBody
(
joinPoint
));
clear
=
clear
&&
log
!=
null
;
if
(
clear
)
{
Log
.
threadBegin
();
start
=
requestLog
(
TAG
,
clear
,
joinPoint
);
}
String
requestBody
=
getRequestBody
(
joinPoint
);
boolean
clear
=
requestLogInit
();
long
start
=
requestLog
(
declaringType
,
TAG
,
url
,
requestBody
,
clear
);
LogVo
log
=
startLog
(
TAG
,
url
,
requestBody
);
Object
result
=
null
;
Exception
ex
=
null
;
...
...
@@ -71,7 +67,7 @@ public class FeignAspect extends BaseRequestAspect {
ex
=
e
;
throw
e
;
}
finally
{
responseLog
(
log
,
TAG
,
url
,
clear
,
joinPoint
,
start
,
result
,
ex
);
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
result
,
ex
,
log
);
}
}
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/MqAspect.java
View file @
68166749
...
...
@@ -2,7 +2,6 @@ package com.yanzuoguang.cloud.aop;
import
com.yanzuoguang.mq.plan.YzgMqConsumer
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.vo.LogVo
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
...
...
@@ -43,17 +42,15 @@ public class MqAspect extends BaseRequestAspect {
@Around
(
value
=
"mqAspect()"
)
public
Object
requestWebAround
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
boolean
clear
=
isRabbit
(
joinPoint
);
LogVo
log
=
null
;
long
start
=
System
.
currentTimeMillis
();
String
url
=
getMethodUrl
(
joinPoint
);
if
(
clear
)
{
log
=
startLog
(
TAG
,
url
,
getRequestBody
(
joinPoint
));
clear
=
clear
&&
log
!=
null
;
}
if
(
clear
)
{
Log
.
threadBegin
();
start
=
requestLog
(
TAG
,
clear
,
joinPoint
);
clear
=
clear
&&
requestLogInit
();
}
Class
declaringType
=
joinPoint
.
getSignature
().
getDeclaringType
();
String
url
=
getMethodUrl
(
joinPoint
);
String
requestBody
=
getRequestBody
(
joinPoint
);
long
start
=
requestLog
(
declaringType
,
TAG
,
url
,
requestBody
,
clear
);
LogVo
log
=
startLog
(
TAG
,
url
,
requestBody
);
Object
result
=
null
;
Exception
ex
=
null
;
try
{
...
...
@@ -65,7 +62,7 @@ public class MqAspect extends BaseRequestAspect {
ex
=
e
;
throw
e
;
}
finally
{
responseLog
(
log
,
TAG
,
url
,
clear
,
joinPoint
,
start
,
result
,
ex
);
responseLog
(
declaringType
,
TAG
,
url
,
clear
,
start
,
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