Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3548158f
authored
Jun 14, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口日志,改用json显示输出
1 parent
2919af32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/interceptor/RequestInterceptor.java
project-order/src/main/java/com/alibaba/cloud/integration/order/interceptor/RequestInterceptor.java
View file @
3548158
package
com
.
alibaba
.
cloud
.
integration
.
order
.
interceptor
;
package
com
.
alibaba
.
cloud
.
integration
.
order
.
interceptor
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
...
@@ -69,7 +70,8 @@ public class RequestInterceptor implements HandlerInterceptor {
...
@@ -69,7 +70,8 @@ public class RequestInterceptor implements HandlerInterceptor {
long
startTime
=
System
.
currentTimeMillis
();
long
startTime
=
System
.
currentTimeMillis
();
Object
result
=
proceedingJoinPoint
.
proceed
();
Object
result
=
proceedingJoinPoint
.
proceed
();
// 打印出参
// 打印出参
log
.
info
(
"Response Args : {}"
,
result
);
// log.info("Response Args : {}", result);
log
.
info
(
"Response Args : {}"
,
new
ObjectMapper
().
writeValueAsString
(
result
));
// 执行耗时
// 执行耗时
log
.
info
(
"Time-Consuming : {} ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"Time-Consuming : {} ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"=========================================== End ==========================================="
);
log
.
info
(
"=========================================== End ==========================================="
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment