Google.Cloud.Diagnostics.AspNetCore3 - Class TraceIdLogEntryLabelProvider (5.2.0)

public class TraceIdLogEntryLabelProvider : HttpLogEntryLabelProvider, ILogEntryLabelProvider

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

A Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider implementation which adds the TraceIdentifier to the log entry labels.

Inheritance

object > HttpLogEntryLabelProvider > TraceIdLogEntryLabelProvider

Implements

Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Constructors

TraceIdLogEntryLabelProvider(IHttpContextAccessor)

public TraceIdLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor)

Initializes a new instance of the TraceIdLogEntryLabelProvider class.

Parameter
Name Description
httpContextAccessor IHttpContextAccessor

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 Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider using the HttpContext instance.

Parameters
Name Description
labels Dictionarystringstring

The log entry labels to augment.

httpContext HttpContext

The HttpContext instance.

Overrides