Google.Cloud.Diagnostics.Common - Class LoggingExtensions (5.1.0)

Stay organized with collections Save and categorize content based on your preferences.
public static class LoggingExtensions

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class LoggingExtensions.

Extension methods for registering Google Cloud Logging.

Inheritance

object > LoggingExtensions

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

AddGoogle(ILoggingBuilder, LoggingServiceOptions)

public static ILoggingBuilder AddGoogle(this ILoggingBuilder builder, LoggingServiceOptions options = null)
Parameters
NameDescription
builderILoggingBuilder
optionsLoggingServiceOptions
Returns
TypeDescription
ILoggingBuilder

AddLogEntryLabelProviderSingleton<T>(IServiceCollection)

public static IServiceCollection AddLogEntryLabelProviderSingleton<T>(this IServiceCollection services) where T : class, ILogEntryLabelProvider

Adds a ILogEntryLabelProvider of type T to the service collection instance as a singleton.

Parameter
NameDescription
servicesIServiceCollection

The IServiceCollection instance.

Returns
TypeDescription
IServiceCollection

The IServiceCollection instance.

Type Parameter
NameDescription
T

The type of the ILogEntryLabelProvider implementation.

AddLogEntryLabelProviderSingleton<T>(IServiceCollection, T)

public static IServiceCollection AddLogEntryLabelProviderSingleton<T>(this IServiceCollection services, T instance) where T : class, ILogEntryLabelProvider

Adds a ILogEntryLabelProvider of type T to the service collection instance as a singleton.

Parameters
NameDescription
servicesIServiceCollection

The IServiceCollection instance.

instanceT

The instance of T.

Returns
TypeDescription
IServiceCollection

The IServiceCollection instance.

Type Parameter
NameDescription
T

The type of the ILogEntryLabelProvider implementation.

AddLogEntryLabelProviderSingleton<T>(IServiceCollection, Func<IServiceProvider, T>)

public static IServiceCollection AddLogEntryLabelProviderSingleton<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, ILogEntryLabelProvider

Adds a ILogEntryLabelProvider of type T to the service collection instance as a singleton.

Parameters
NameDescription
servicesIServiceCollection

The IServiceCollection instance.

implementationFactoryFuncIServiceProvider

The factory that creates the service.

Returns
TypeDescription
IServiceCollection

The IServiceCollection instance.

Type Parameter
NameDescription
T

The type of the ILogEntryLabelProvider implementation.