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
8806a540
Commit
8806a540
authored
Aug 08, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
常规BUG的修改
parent
6f6143b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
CloudContans.java
...oud/src/main/java/com/yanzuoguang/cloud/CloudContans.java
+0
-5
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+24
-3
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/CloudContans.java
View file @
8806a540
...
...
@@ -5,9 +5,4 @@ package com.yanzuoguang.cloud;
* @author 颜佐光
*/
public
class
CloudContans
{
/**
* 日志模块
*/
public
static
final
String
LOG_MODULE
=
"log"
;
}
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
View file @
8806a540
...
...
@@ -42,6 +42,12 @@ public class BaseRequestAspect implements ThreadNext.Next {
@Value
(
"${yzg.reqSize:5000}"
)
private
int
reqSize
;
@Value
(
"${yzg.log.notFilter:login}"
)
private
String
notFilter
;
@Value
(
"${yzg.log.filter:log}"
)
private
String
filter
;
@Autowired
protected
ApplicationContext
context
;
...
...
@@ -166,9 +172,7 @@ public class BaseRequestAspect implements ThreadNext.Next {
}
// 日志请求不记录,防止死循环递归
boolean
isLog
=
applicationName
.
indexOf
(
CloudContans
.
LOG_MODULE
)
>=
0
||
name
.
indexOf
(
CloudContans
.
LOG_MODULE
)
>=
0
||
url
.
indexOf
(
CloudContans
.
LOG_MODULE
)
>=
0
;
boolean
isLog
=
isLog
(
name
,
url
);
if
(
isLog
)
{
return
;
}
...
...
@@ -189,6 +193,23 @@ public class BaseRequestAspect implements ThreadNext.Next {
}
}
/**
* 是否属于日志服务
*
* @param name
* @param url
* @return
*/
private
boolean
isLog
(
String
name
,
String
url
)
{
boolean
notFilter
=
applicationName
.
matches
(
filter
)
||
name
.
matches
(
filter
)
||
url
.
matches
(
filter
);
if
(
notFilter
)
{
return
false
;
}
boolean
isLog
=
applicationName
.
matches
(
filter
)
||
name
.
matches
(
filter
)
||
url
.
matches
(
filter
);
return
isLog
;
}
/**
* 执行下一个函数,出现异常会继续执行
*
...
...
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