How is HttpContext TraceIdentifier generated in .NET Core?

后端 未结 2 636
轻奢々
轻奢々 2021-01-04 02:01

How is HttpContext TraceIdentifier (aka Correlation-Id) generated?

I request a page through controller which gives me the following TraceId: 0HLEACIU86PT6:00000

2条回答
  •  失恋的感觉
    2021-01-04 02:35

    It is DateTime.UtcNow.Ticks base32 encoded.

    https://github.com/aspnet/HttpAbstractions/blob/87cd79d6fc54bb4abf07c1e380cd7a9498a78612/src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs

提交回复
热议问题