Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
40ec9c5f
Commit
40ec9c5f
authored
Jan 09, 2023
by
macro
Browse files
日志切面逻辑修改
parent
2c135760
Changes
1
Hide whitespace changes
Inline
Side-by-side
mall-common/src/main/java/com/macro/mall/common/log/WebLogAspect.java
View file @
40ec9c5f
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import
cn.hutool.core.util.URLUtil
;
import
cn.hutool.core.util.URLUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.domain.WebLog
;
import
com.macro.mall.common.domain.WebLog
;
import
com.macro.mall.common.util.RequestUtil
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
net.logstash.logback.marker.Markers
;
import
net.logstash.logback.marker.Markers
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
...
@@ -70,7 +71,7 @@ public class WebLogAspect {
...
@@ -70,7 +71,7 @@ public class WebLogAspect {
String
urlStr
=
request
.
getRequestURL
().
toString
();
String
urlStr
=
request
.
getRequestURL
().
toString
();
webLog
.
setBasePath
(
StrUtil
.
removeSuffix
(
urlStr
,
URLUtil
.
url
(
urlStr
).
getPath
()));
webLog
.
setBasePath
(
StrUtil
.
removeSuffix
(
urlStr
,
URLUtil
.
url
(
urlStr
).
getPath
()));
webLog
.
setUsername
(
request
.
getRemoteUser
());
webLog
.
setUsername
(
request
.
getRemoteUser
());
webLog
.
setIp
(
r
equest
.
getRe
moteAddr
(
));
webLog
.
setIp
(
R
equest
Util
.
getRe
questIp
(
request
));
webLog
.
setMethod
(
request
.
getMethod
());
webLog
.
setMethod
(
request
.
getMethod
());
webLog
.
setParameter
(
getParameter
(
method
,
joinPoint
.
getArgs
()));
webLog
.
setParameter
(
getParameter
(
method
,
joinPoint
.
getArgs
()));
webLog
.
setResult
(
result
);
webLog
.
setResult
(
result
);
...
@@ -109,8 +110,10 @@ public class WebLogAspect {
...
@@ -109,8 +110,10 @@ public class WebLogAspect {
if
(!
StrUtil
.
isEmpty
(
requestParam
.
value
()))
{
if
(!
StrUtil
.
isEmpty
(
requestParam
.
value
()))
{
key
=
requestParam
.
value
();
key
=
requestParam
.
value
();
}
}
map
.
put
(
key
,
args
[
i
]);
if
(
args
[
i
]!=
null
){
argList
.
add
(
map
);
map
.
put
(
key
,
args
[
i
]);
argList
.
add
(
map
);
}
}
}
}
}
if
(
argList
.
size
()
==
0
)
{
if
(
argList
.
size
()
==
0
)
{
...
...
Write
Preview
Supports
Markdown
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