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
8563fbdf
Commit
8563fbdf
authored
Mar 19, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
eda03961
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+6
-5
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 @
8563fbdf
...
...
@@ -191,7 +191,8 @@ public class BaseRequestAspect {
protected
void
responseLog
(
LogVo
log
,
String
tag
,
String
url
,
boolean
logFlag
,
ProceedingJoinPoint
joinPoint
,
long
start
,
Object
result
,
Exception
resultEx
)
{
try
{
long
time
=
System
.
currentTimeMillis
()
-
start
;
boolean
isLog
=
(
logFlag
&&
logCommon
&&
!
this
.
logLocal
.
isLog
(
tag
,
url
))
||
resultEx
!=
null
;
boolean
isLogDisplay
=
(
logFlag
&&
logCommon
)
||
resultEx
!=
null
;
boolean
isLogDatabase
=
(
logFlag
&&
log
!=
null
)
||
resultEx
!=
null
;
String
name
=
joinPoint
.
getSignature
().
getName
();
// 处理结果
ResponseResult
responseResult
=
responseDefault
;
...
...
@@ -205,12 +206,12 @@ public class BaseRequestAspect {
responseResult
=
ExceptionHelper
.
getError
(
resultEx
);
resultEx
.
printStackTrace
();
}
if
(
isLog
)
{
if
(
isLog
Display
)
{
Log
.
error
(
joinPoint
.
getSignature
().
getDeclaringType
(),
resultEx
,
"%s [ %s ] time %d ms, result: %s"
,
tag
,
name
,
time
,
getMaxString
(
JsonHelper
.
serialize
(
responseResult
)));
if
(
log
!=
null
)
{
logLocal
.
result
(
log
,
name
,
responseResult
.
getCode
(),
JsonHelper
.
serialize
(
responseResult
));
}
if
(
isLogDatabase
)
{
logLocal
.
result
(
log
,
name
,
responseResult
.
getCode
(),
JsonHelper
.
serialize
(
responseResult
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
View file @
8563fbdf
...
...
@@ -73,7 +73,7 @@ public class WebAspect extends BaseRequestAspect {
LogVo
log
=
null
;
boolean
clear
=
requestLogInit
();
long
start
=
System
.
currentTimeMillis
();
String
url
=
getMethodUrl
(
joinPoint
);
String
url
=
HttpAspectUtil
.
getHttpRequestUrl
(
);
if
(
clear
)
{
log
=
startLog
(
TAG
,
url
,
getRequestBody
(
joinPoint
));
clear
=
clear
&&
log
!=
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