Skip to content

Include userId in log messages by using MDC #1102

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

Closed
php-coder opened this issue Jul 24, 2019 · 2 comments
Closed

Include userId in log messages by using MDC #1102

php-coder opened this issue Jul 24, 2019 · 2 comments
Assignees
Labels
area/logging estimation/45m Estimated time: 45 minutes kind/task Task that is part of some feature
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Jul 24, 2019

Acceptance criteria:

  • every log message contains userId

How to achieve that:

  • add Servlet Filter that puts userId into MDC
  • modify log pattern to include a userId from MDC

Hint:

Part of #388

@php-coder php-coder added the kind/task Task that is part of some feature label Jul 24, 2019
@php-coder php-coder added this to the 0.4.1 milestone Jul 24, 2019
@mukeshk
Copy link
Contributor

mukeshk commented Jul 25, 2019

How about an anonymous user?

@php-coder
Copy link
Owner Author

In this case, log message will contain an empty userId. The same for Spring Boot logs or repeated tasks that we run for maintenance.

Another option is to use 0 UID as it never exists. Let's use the first approach and will change it if necessary.

mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 27, 2019
mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 27, 2019
mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 28, 2019
mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 28, 2019
mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 28, 2019
mukeshk added a commit to mukeshk/mystamps that referenced this issue Jul 28, 2019
@php-coder php-coder added the estimation/45m Estimated time: 45 minutes label Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging estimation/45m Estimated time: 45 minutes kind/task Task that is part of some feature
Projects
None yet
Development

No branches or pull requests

2 participants