-
Notifications
You must be signed in to change notification settings - Fork 34
task : include userId in the log messages by using MDC. #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task : include userId in the log messages by using MDC. #1103
Conversation
Generated by 🚫 Danger |
To Discuss:
|
Need your ideas. |
Awesome! I'll look in it later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
See my comments.
|
||
|
||
@Bean | ||
public FilterRegistrationBean getMdcLogEnhancerFilter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that our filter registration is simple, let's just declare that bean as others. In other wods, we don't need to use FilterRegistrationBean
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll take a look tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: tomorrow :/
Things which go through CSP - dont have it. How do I test it further? Check for GET/CREATE/REMOVE actions. |
9408307
to
13a11b7
Compare
13a11b7
to
4ecf0a5
Compare
src/main/java/ru/mystamps/web/support/spring/security/UserMdcLoggingFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/support/spring/security/UserMdcLoggingFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/support/spring/security/UserMdcLoggingFilter.java
Outdated
Show resolved
Hide resolved
Could you, please, modify commit message?
|
src/main/java/ru/mystamps/web/support/spring/security/SecurityConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/support/spring/security/SecurityConfig.java
Outdated
Show resolved
Hide resolved
4ecf0a5
to
646fd3a
Compare
src/main/java/ru/mystamps/web/support/spring/security/SecurityConfig.java
Show resolved
Hide resolved
646fd3a
to
d93b033
Compare
src/main/java/ru/mystamps/web/support/spring/security/UserMdcLoggingFilter.java
Show resolved
Hide resolved
The first line of a commit message still has to be updated to
|
d93b033
to
0630ebc
Compare
please review. Is this good? |
Yes, thank you! Could you update git commit also? (see my comments above). |
There is an issue with a current implementation: this filter doesn't get applied to error pages (try to open Yes, it means that we need to put back FilterRegistrationBean back :) |
0630ebc
to
bf42149
Compare
bf42149
to
94e87d5
Compare
I have put the @bean public FilterRegistrationBean userMdcLoggingFilter() { 2019-07-29 20:34:53.224 [user: ] WARN 23944 --- [tp1635327890-33] r.m.web.feature.site.CspController Other requests like adding, and remove collection - event - userId is recorded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I've played with it and here is what I found out: it works when |
I've created an issue for tracking it: #1106 |
@mukeshk Good work, thank you! 👍 |
Addressed to #1102