C# Класс JSNLog.Infrastructure.RequestId

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetLogRequestId ( this httpContext ) : string

Gets the request id from an HTTP header in the request. Every log request sent by jsnlog.js should have such a header. However, requests not sent by jsnlog.js will not have this header obviously. If the request id cannot be found, returns null.

GetLogRequestId ( string>.this headers ) : string
GetRequestId ( this httpContext ) : string

Gets an id, that is unique to this request. That is, for the same request, this method always returns the same string.

Приватные методы

Метод Описание
CreateNewRequestId ( ) : string
GetRequestIdFromContext ( HttpContext httpContext ) : string
IISRequestId ( HttpContext httpContext ) : string

Creates an ID that is unique hopefully. This method initially tries to use the request id that IIS already uses internally. This allows us to correlate across even more log files. If this fails, for example if this is not part of a web request, than it uses a random GUID. See http://blog.tatham.oddie.com.au/2012/02/07/code-request-correlation-in-asp-net/

SetRequestIdInContext ( HttpContext httpContext, string requestId ) : void

Описание методов

GetLogRequestId() публичный статический Метод

Gets the request id from an HTTP header in the request. Every log request sent by jsnlog.js should have such a header. However, requests not sent by jsnlog.js will not have this header obviously. If the request id cannot be found, returns null.
public static GetLogRequestId ( this httpContext ) : string
httpContext this
Результат string

GetLogRequestId() публичный статический Метод

public static GetLogRequestId ( string>.this headers ) : string
headers string>.this
Результат string

GetRequestId() публичный статический Метод

Gets an id, that is unique to this request. That is, for the same request, this method always returns the same string.
public static GetRequestId ( this httpContext ) : string
httpContext this
Результат string