# Class UserLogEntryLabelProvider (4.4.0)

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

- [4.4.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.UserLogEntryLabelProvider)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/4.3.1/Google.Cloud.Diagnostics.AspNetCore.UserLogEntryLabelProvider)

    public class UserLogEntryLabelProvider : HttpLogEntryLabelProvider, ILogEntryLabelProvider, ILogEntryLabelProvider

A [ILogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.ILogEntryLabelProvider) which adds the information of the authenticated user 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.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.HttpLogEntryLabelProvider) \> UserLogEntryLabelProvider

## Implements

[ILogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.ILogEntryLabelProvider), [ILogEntryLabelProvider](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider.html)

## Inherited Members

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

## Namespace

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

## Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

## Constructors

### UserLogEntryLabelProvider(IHttpContextAccessor)

    public UserLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor)

Initializes a new instance of the [UserLogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.UserLogEntryLabelProvider) 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 [ILogEntryLabelProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.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-2<https://learn.microsoft.com/dotnet/api/system.string, https://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.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.HttpLogEntryLabelProvider#Google_Cloud_Diagnostics_AspNetCore_HttpLogEntryLabelProvider_InvokeCore_System_Collections_Generic_Dictionary_System_String_System_String__Microsoft_AspNetCore_Http_HttpContext_)