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
jinli gu
JeeSpringCloud
Commits
06a04145
Commit
06a04145
authored
Dec 21, 2018
by
Suncos
Browse files
no commit message
parent
c38a622d
Changes
1
Hide whitespace changes
Inline
Side-by-side
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/sys/interceptor/LogInterceptor.java
View file @
06a04145
...
...
@@ -43,8 +43,10 @@ public class LogInterceptor extends AbstractService implements HandlerIntercepto
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
if
(!
"/error"
.
equals
(
request
.
getRequestURI
()))
{
logger
.
info
(
"URI: {},耗时:{} "
,
request
.
getRequestURI
()
+
"-"
+
request
.
getMethod
()
,
DateUtils
.
formatDateTime
(
System
.
currentTimeMillis
()
-
startTimeThreadLocal
.
get
()));
try
{
logger
.
info
(
"URI: {},耗时:{} "
,
request
.
getRequestURI
()
+
"-"
+
request
.
getMethod
()
,
DateUtils
.
formatDateTime
(
System
.
currentTimeMillis
()
-
startTimeThreadLocal
.
get
()));
}
catch
(
Exception
e
){
e
.
toString
();
}
}
//删除线程变量中的数据,防止内存泄漏
startTimeThreadLocal
.
remove
();
...
...
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