Is there a way to enrich Serilog
log data in ASP.NET Core 2.1 application, similar to how enrichers WithUserName
and WithHttpRequestUserAgent
work for classic ASP.NET (System.Web
)?
I tried implementing ILogEventEnricher
interface, but it does not work, because I am not able to gain access to RequestContext
from my custom enricher.