-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
HttpLogging middleware should have an option to filter out endpoints #40950
Comments
For static files at least, you can address that by changing the order of your middleware so logging comes after static files. One way to go about this would be to put opt-in or opt-out attributes on specific endpoints. Another way (that we generally avoid) is having a callback, but people tend to re-invent routing in such callbacks. |
Thanks for contacting us. We're moving this issue to the |
This feature will be useful for filter out healthchecks calls with 200 status code in kubernetes |
Making the middleware endpoint aware could address this. #43222 |
Thanks for contacting us. We're moving this issue to the |
It is possible to use UseWhen to selectively add http logging to only some endpoints, like so:
|
I'm going to close this as a duplicate of two more specific proposals: |
I would suggest to implement a feature to filter requests for given endpoints which should be logged using that middleware.
F.e. right now as I wanted to log only data related to my API endpoints it's not possible. Enabling this middleware will log also all requests like for static files etc. creating a mess in my log.
The text was updated successfully, but these errors were encountered: