public static class LoggingExtensions
Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class LoggingExtensions.
Extension methods for registering Google Cloud Logging.
Namespace
GoogleCloudGoogle.Cloud.DiagnosticsCommonAssembly
Google.Cloud.Diagnostics.Common.dll
Methods
AddGoogle(ILoggingBuilder, LoggingServiceOptions)
public static ILoggingBuilder AddGoogle(this ILoggingBuilder builder, LoggingServiceOptions options = null)
Adds a GoogleLoggerProvider for GoogleLoggers.
Parameters | |
---|---|
Name | Description |
builder | ILoggingBuilder |
options | LoggingServiceOptions |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
services | IServiceCollection The IServiceCollection instance. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The IServiceCollection instance. |
Type Parameter | |
---|---|
Name | Description |
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 | |
---|---|
Name | Description |
services | IServiceCollection The IServiceCollection instance. |
instance | T The instance of |
Returns | |
---|---|
Type | Description |
IServiceCollection | The IServiceCollection instance. |
Type Parameter | |
---|---|
Name | Description |
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 | |
---|---|
Name | Description |
services | IServiceCollection The IServiceCollection instance. |
implementationFactory | FuncIServiceProvider The factory that creates the service. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The IServiceCollection instance. |
Type Parameter | |
---|---|
Name | Description |
T | The type of the ILogEntryLabelProvider implementation. |