0

I was using HttpRequestIdEnricher for my Asp.net web api so I can have a unique request Id for each incoming request, that used to work when the service was hosted under IIS, however adter upgrading to use self-hosted(api is hosted in a windows service) this stopped working! Is what I am trying to do supported or I can't use HttpRequestIdEnricher if the API is self-hosted?

4

2 回答 2

2

I believe I can answer my own question, for Serilog to work with OWIN it has to use the SerilogWeb.Owin rather than web classic one, as the Web won't work when using OWIN.

For RequestId this can be done using appBuilder.UseSerilogRequestContext();

于 2015-09-16T05:36:02.437 回答
1

The Classic designation in this package's name denotes "Classic ASP.NET" as opposed to the self-host/OWIN/DNX variants as you've noted. (Unfortunately it's hard to find a name that captures this succinctly :-) .)

于 2015-09-17T22:06:45.213 回答