Class EnvironmentNameLogEntryLabelProvider (4.4.0)

public class EnvironmentNameLogEntryLabelProvider : ILogEntryLabelProvider, ILogEntryLabelProvider

A ILogEntryLabelProvider implementation which adds the EnvironmentName to the log entry labels.

Inheritance

Object > EnvironmentNameLogEntryLabelProvider

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

Constructors

EnvironmentNameLogEntryLabelProvider(IHostingEnvironment)

public EnvironmentNameLogEntryLabelProvider(IHostingEnvironment hostingEnvironment)

Initializes a new instance of the EnvironmentNameLogEntryLabelProvider class.

Parameter
NameDescription
hostingEnvironmentIHostingEnvironment

The IHostingEnvironment instance to retrieve the environment name from.

Methods

Invoke(Dictionary<String, String>)

public void Invoke(Dictionary<string, string> labels)

Invokes the provider to augment log entry labels.

Parameter
NameDescription
labelsDictionary<String, String>

A dictionary of log entry labels. Keys and values added to labels should not be null. If they are, an exception will be throw when attempting to log an entry. The entry won't be logged and the exception will be propagated depending on the value of ExceptionHandling.