Description
This problem was discovered when using SerilogWeb.Classic UserName enricher. When ApplicationLifecycle module emits the final log entry for a request, the user name of the authenticated user is no longer captured by the UserName enricher.
It looks like HttpContext.Current.User.Identity.IsAuthenticated becomes 'false' by that point in time.
https://github.com/serilog-web/classic/blob/master/src/SerilogWeb.Classic/Classic/Enrichers/UserNameEnricher.cs
The problem first appered after updating to Microsoft.AspNet.WebApi 5.2.5 and is still in 5.2.6. The following screenshot of the logged data illustrates the problem. The only change between the 3 runs was a bump in versions of the Microsoft.AspNet.WebApi.* nuget packages.
For more information, see a related bug report at SerilogWeb.Classic project:
serilog-web/classic#55