Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
b6538ecc
Commit
b6538ecc
authored
Oct 21, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
fafe4e01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
LogInterceptor.java
.../java/com/gic/haoban/manage/web/utils/LogInterceptor.java
+30
-0
spring-interceptor.xml
...manage3-wx/src/main/webapp/WEB-INF/spring-interceptor.xml
+1
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/utils/LogInterceptor.java
0 → 100644
View file @
b6538ecc
package
com
.
gic
.
haoban
.
manage
.
web
.
utils
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.gic.commons.util.IPUtil
;
public
class
LogInterceptor
extends
HandlerInterceptorAdapter
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
LogInterceptor
.
class
);
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
object
)
throws
Exception
{
String
uri
=
request
.
getRequestURI
();
Map
<
String
,
String
[]>
parameterMap
=
request
.
getParameterMap
();
String
ip
=
null
;
try
{
ip
=
IPUtil
.
getIpAddr
(
request
);
}
catch
(
Exception
e
)
{
}
log
.
info
(
"请求参数,ip={},url={},参数={}"
,
ip
,
uri
,
parameterMap
);
return
true
;
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/spring-interceptor.xml
View file @
b6538ecc
...
...
@@ -4,6 +4,7 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"
>
<mvc:interceptors>
<bean
class=
"com.gic.commons.interceptor.HeaderTagInterceptor"
/>
<bean
class=
"com.gic.haoban.manage.web.utils.LogInterceptor"
/>
<bean
class=
"com.gic.haoban.common.interceptor.HttpLimitInterceptor"
/>
<bean
class=
"com.gic.haoban.common.ext.PropertyViewClearInterceptor"
/>
<mvc:interceptor>
...
...
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