Open Zetanova opened 2 years ago
@wtgodbe Can you please take a look?
Thanks for contacting us.
We're moving this issue to the .NET 7 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
Prior discussion: https://github.com/dotnet/aspnetcore/issues/11305
I'm also having the same issue. As a workaround, I'm avoiding the HttpLoggingMiddleware for gRPC requests
builder.UseWhen(
ctx => ctx.Request.ContentType != "application/grpc",
builder =>
{
builder.UseHttpLogging();
}
);
Thanks for contacting us.
We're moving this issue to the .NET 8 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
There's a PR for this which could be iterated on/abandoned: https://github.com/dotnet/aspnetcore/pull/39989
At least, some potential impacts on gRPC could be indicated on the http-logging.
This could save a few days for folks in the unlikely scenario of having both logging and gRPC at the same time..
This could save a few days for folks in the unlikely scenario of having both logging and gRPC at the same time..
Because it's open source and you have stumbled across an issue I guess you could try and fix it ;)
Because it's open source and you have stumbled across an issue I guess you could try and fix it ;)
Yes I can, and yes I have, but I think this needs a little bit of design work before that could happen. For example, extended http client logger solves this by forcing you to spell out content types that you wish to log. Matter of fact I've filed https://github.com/dotnet/extensions/issues/5206 because there's features missing on both sides and no obvious reason why they have to be different.
However, my disappointment was because this is a flat out bug as both middlewares are provided out of the box. I guess https://github.com/dotnet/aspnetcore/issues/39317#issuecomment-1180514981 is the the fastest way to workaround this today vs. waiting for this to get triaged some day (and from experience, if it doesn't get triaged it won't get accepted even if there's an implementation for it, just like enumerable support for list patterns that I have a PR open for a year now)
Is there an existing issue for this?
Describe the bug
If the
HttpLoggingMiddleware
gets used in aspnet core 6 hosting Rest API and gRPC service then the gRPC response message gets transparently removed.The verbose logging of
Grpc.AspNetCore.Server.ServerCallHandler
logs following:The verbose logging of
Grpc.Net.Client.Internal.GrpcCall
logs following:Only the outgoing response message gets somehow removed by
HttpLoggingMiddleware
Disabling it resolves the issue instantlyExpected Behavior
HttpLoggingMiddleware
should only log normal http requests and/or give more options to enable or filter gRPC loggingSteps To Reproduce
service configuration:
Configuration
Exceptions (if any)
On the gRPC Client side, inside an rest api
.NET Version
6.0.100
Anything else?
No response