Use GUID as TraceIdentifier in ASP.NET Core Web API Set a generated unique id to HttpContext.TraceIdentifier using middleware. Click here to read the article