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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Google.Cloud.Diagnostics.Common - Class LoggingExtensions (5.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.3.0 (latest)](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.LoggingExtensions)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.LoggingExtensions)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.LoggingExtensions)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.LoggingExtensions)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.LoggingExtensions)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.LoggingExtensions) \n\n public static class LoggingExtensions\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common class LoggingExtensions.\n\nExtension methods for registering Google Cloud Logging. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e LoggingExtensions \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Diagnostics.Common](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)\n\nAssembly\n--------\n\nGoogle.Cloud.Diagnostics.Common.dll\n\nMethods\n-------\n\n### AddGoogle(ILoggingBuilder, LoggingServiceOptions)\n\n public static ILoggingBuilder AddGoogle(this ILoggingBuilder builder, LoggingServiceOptions options = null)\n\nAdds a [GoogleLoggerProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.GoogleLoggerProvider) for [GoogleLogger](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.GoogleLogger)s.\n\n### AddLogEntryLabelProviderSingleton\\\u003cT\\\u003e(IServiceCollection)\n\n public static IServiceCollection AddLogEntryLabelProviderSingleton\u003cT\u003e(this IServiceCollection services) where T : class, ILogEntryLabelProvider\n\nAdds a [ILogEntryLabelProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider) of type `T` to the service collection instance\nas a singleton.\n\n### AddLogEntryLabelProviderSingleton\\\u003cT\\\u003e(IServiceCollection, Func\\\u003cIServiceProvider, T\\\u003e)\n\n public static IServiceCollection AddLogEntryLabelProviderSingleton\u003cT\u003e(this IServiceCollection services, Func\u003cIServiceProvider, T\u003e implementationFactory) where T : class, ILogEntryLabelProvider\n\nAdds a [ILogEntryLabelProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider) of type `T` to the service collection instance\nas a singleton.\n\n### AddLogEntryLabelProviderSingleton\\\u003cT\\\u003e(IServiceCollection, T)\n\n public static IServiceCollection AddLogEntryLabelProviderSingleton\u003cT\u003e(this IServiceCollection services, T instance) where T : class, ILogEntryLabelProvider\n\nAdds a [ILogEntryLabelProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILogEntryLabelProvider) of type `T` to the service collection instance\nas a singleton."]]