Google.Cloud.Diagnostics.AspNetCore3 - Class ClientIpLogEntryLabelProvider (5.1.0)

public class ClientIpLogEntryLabelProvider : HttpLogEntryLabelProvider, ILogEntryLabelProvider

Reference documentation and code samples for the Google.Cloud.Diagnostics.AspNetCore3 class ClientIpLogEntryLabelProvider.

A ILogEntryLabelProvider implementation which adds the client's IP-address to the log entry labels.

Inheritance

object > HttpLogEntryLabelProvider > ClientIpLogEntryLabelProvider

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsAspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Constructors

ClientIpLogEntryLabelProvider(IHttpContextAccessor)

public ClientIpLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor)

Initializes a new instance of the ClientIpLogEntryLabelProvider class.

Parameter
NameDescription
httpContextAccessorIHttpContextAccessor

The IHttpContextAccessor instance with the HttpContext.

Methods

InvokeCore(Dictionary<string, string>, HttpContext)

protected override void InvokeCore(Dictionary<string, string> labels, HttpContext httpContext)

In a derived class, invokes the core logic of the ILogEntryLabelProvider using the HttpContext instance.

Parameters
NameDescription
labelsDictionarystringstring

The log entry labels to augment.

httpContextHttpContext

The HttpContext instance.

Overrides