Skip to content
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

Provide servlet request listener which fill the MDC #769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csware
Copy link

@csware csware commented Jan 19, 2024

This is seen as superior to a filter as the MDC is not cleared before an error handler servlet is executed.

cf. PR #768

public class MDCInsertingServletRequestListener implements ServletRequestListener {
@Override
public void requestInitialized(ServletRequestEvent sre) {
insertIntoMDC(sre.getServletRequest());
Copy link
Author

@csware csware Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we could also call the insertIntoMDC in the MDCInsertingServletFilter to avoid code duplication.

This is seen as superior to a filter as the MDC is not cleared before an error handler servlet is executed.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
@csware csware force-pushed the mdc-servlet-request-listener branch from 52818a8 to f1ba14a Compare January 19, 2024 11:55
@csware
Copy link
Author

csware commented Jan 19, 2024

TODO: The documentation needs updating...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant