# Google.Cloud.Diagnostics.AspNetCore3 - Class ClientIpLogEntryLabelProvider (5.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [5.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)
- [5.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/5.2.0/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)
- [5.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/5.1.0/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)
- [5.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/5.0.0/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/4.4.0/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/4.3.1/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider)

    public class ClientIpLogEntryLabelProvider : HttpLogEntryLabelProvider, ILogEntryLabelProvider

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

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

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [HttpLogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3.HttpLogEntryLabelProvider) \> ClientIpLogEntryLabelProvider

## Implements

Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider

## Inherited Members

[HttpLogEntryLabelProvider.Invoke(Dictionary\<string, string\>)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3.HttpLogEntryLabelProvider#Google_Cloud_Diagnostics_AspNetCore3_HttpLogEntryLabelProvider_Invoke_System_Collections_Generic_Dictionary_System_String_System_String__) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Diagnostics.AspNetCore3](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3)

## Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

## Constructors

### ClientIpLogEntryLabelProvider(IHttpContextAccessor)

    public ClientIpLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor)

Initializes a new instance of the [ClientIpLogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3.ClientIpLogEntryLabelProvider) class.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `httpContextAccessor` | `https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor` The [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) instance with the [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.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 Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider using the [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) instance.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `labels` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2https://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` The log entry labels to augment. |
| `httpContext` | `https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext` The [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) instance. |

**Overrides** [HttpLogEntryLabelProvider.InvokeCore(Dictionary\<string, string\>, HttpContext)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest/Google.Cloud.Diagnostics.AspNetCore3.HttpLogEntryLabelProvider#Google_Cloud_Diagnostics_AspNetCore3_HttpLogEntryLabelProvider_InvokeCore_System_Collections_Generic_Dictionary_System_String_System_String__Microsoft_AspNetCore_Http_HttpContext_)