Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
dd8e3a13
Commit
dd8e3a13
authored
Oct 22, 2019
by
michael.simon
Browse files
Add remote ip address to MDC logging context
Can be retrieved by %X{ipAddr} in Logging pattern.
parent
f1e6ccd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
bwreg-webapp/src/main/java/edu/kit/scc/webreg/sec/SecurityFilter.java
View file @
dd8e3a13
...
...
@@ -32,6 +32,7 @@ import javax.servlet.http.HttpSession;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.MDC
;
import
edu.kit.scc.webreg.bootstrap.ApplicationConfig
;
import
edu.kit.scc.webreg.entity.AdminUserEntity
;
...
...
@@ -86,6 +87,8 @@ public class SecurityFilter implements Filter {
request
.
setCharacterEncoding
(
"UTF-8"
);
}
MDC
.
put
(
"ipAddr"
,
request
.
getRemoteAddr
());
String
context
=
request
.
getServletContext
().
getContextPath
();
String
path
=
request
.
getRequestURI
().
substring
(
context
.
length
());
...
...
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