Open JamesNK opened 4 years ago
This isn't possible with the current infrastructure. Hosting makes these logs and it only has access to IServerAddresses containing a simple list of urls.
To do this we'd have to redesign it so that the servers issued these logs. Even then it would only work on Kestrel. IIS and HttpSys don't have access to this information at startup, only per request.
What if we provide a new feature (IServerBindings
?) with more detail instead of having servers just dump it to logs? As we expand bedrock and move in to scenarios like QUIC (which binds to UDP ports), we may want more functionality here. For example, when binding to HTTP/1,/2,and /3 the server will actually have two separate bindings (TCP and UDP) even when there is only one "URL".
It's still only going to work for Kestrel so a new abstraction isn't needed, Kestrel can log it directly.
It's still only going to work for Kestrel
That's not true though. Could ANCM query the bindings for the site (in theory)? Could HttpSysServer? Could some other server support this? I don't think it's unreasonable to spend a little time thinking about a design that's more flexible. Logs are useful for user consumption but hard for code to consume and make decisions with. I'm not saying you're wrong that it may not be worth it but I think it's worth some thought.
We'll keep this around to talk about during Bedrock work (cc @davidfowl).
I didn't cover who this would be useful for in the original issue: I was mainly thinking of gRPC which requires HTTP/2. It could help end users debug connection errors when HTTP/2 is not correctly configured.
btw I logged this while watching the ASP.NET standup, and saw Kestrel report the same endpoint twice on startup for QUIC 😋
btw I logged this while watching the ASP.NET standup, and saw Kestrel report the same endpoint twice on startup for QUIC 😋
Yeah, we saw the same thing ;).
Triage decision: This would require a new Server Feature or a breaking change to an existing feature. Probably not happening in 5.0
On startup ASP.NET Core will log the addresses it is listening on.
http
vshttps
gives insight into whether the endpoint is secured with TLS. However there is no way to understand what protocols each endpoint supports. It would be useful when debugging connection errors to have an endpoint's protocol logged.For example: