-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add middleware::logger::custom_response_replace
#2631
add middleware::logger::custom_response_replace
#2631
Conversation
Initial implementation, only exposes the response's status
I figured out a way to execute the original plan of custom response-based replacements. @benny-n let me know what you think of the solution. |
Hi @robjtede, |
@benny-n Yeah, you got it. It works out okay because response bodies are not accessible with only shared refs so it doesn't matter what is in the body slot for our closure here. This way keeps the API free of generics. |
middleware::logger::custom_status_replace
middleware::logger::custom_response_replace
PR Type
Feature
PR Checklist
Overview
It is now possible to pass a closure to the logger, which recevies a
StatusCode
ServiceResponse
and returns aString
for use in the log lineCloses #2627