public class ClientIpLogEntryLabelProvider : HttpLogEntryLabelProvider, ILogEntryLabelProviderReference 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.
Implements
Google.Cloud.Diagnostics.Common.ILogEntryLabelProviderNamespace
Google.Cloud.Diagnostics.AspNetCore3Assembly
Google.Cloud.Diagnostics.AspNetCore3.dll
Constructors
ClientIpLogEntryLabelProvider(IHttpContextAccessor)
public ClientIpLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor)Initializes a new instance of the ClientIpLogEntryLabelProvider class.
| Parameter | |
|---|---|
| Name | Description | 
httpContextAccessor | 
        IHttpContextAccessorThe 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 | 
        DictionarystringstringThe log entry labels to augment.  | 
      
httpContext | 
        HttpContextThe HttpContext instance.  |