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

Requests/Responses of POST requests in spring cloud gateway are not logged #1571

Closed
MatthiasDrews opened this issue Jul 7, 2023 · 1 comment
Labels

Comments

@MatthiasDrews
Copy link
Contributor

Description

In a reactive spring cloud gateway application, with Logbook included, there is no logging of requests and responses for HTTP POST requests, when configuring the strategy logbook.strategy=without-body. With the default strategy logging works as expected.

Expected Behavior

Requests/Responses for HTTP POST requests are logged without the bodies.

Actual Behavior

Requests/Responses for HTTP POST requests are not logged at all

Possible Fix

Reason: The execution of the writeHook is triggered differently between GET and POST requests. For POST requests and withoutBody strategy, it is just never invoked.

Your Environment

  • Version used: 3.1.0
MatthiasDrews pushed a commit to MatthiasDrews/logbook that referenced this issue Jul 7, 2023
MatthiasDrews pushed a commit to MatthiasDrews/logbook that referenced this issue Jul 7, 2023
MatthiasDrews pushed a commit to MatthiasDrews/logbook that referenced this issue Jul 14, 2023
kasmarian pushed a commit that referenced this issue Jul 17, 2023
* log request/response without body for POST (#1571)

* log request/response without body for POST (#1571)

* mocked unit test to fulfill coverage (#1571)

---------

Co-authored-by: Matthias Drews <m.drews@reply.de>
@kasmarian
Copy link
Member

Thank you for the fix @MatthiasDrews , the fix will be part of the next release

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

No branches or pull requests

2 participants