Optional if running on Google App Engine or Google Compute Engine.
The Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be
detected from the platform.
[[["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."],[[["\u003cp\u003eThe \u003ccode\u003eGoogleLoggerFactoryExtensions\u003c/code\u003e class provides extensions for adding \u003ccode\u003eGoogleLoggerProvider\u003c/code\u003es to an \u003ccode\u003eILoggerFactory\u003c/code\u003e, enabling logging to Google Cloud Logging.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddGoogle\u003c/code\u003e methods allow users to integrate Google Cloud Logging by adding a \u003ccode\u003eGoogleLoggerProvider\u003c/code\u003e for \u003ccode\u003eGoogleLogger\u003c/code\u003es, with options to specify a log target, service provider, project ID, logger options, and logging client.\u003c/p\u003e\n"],["\u003cp\u003eThese methods are currently marked as obsolete and recommend the use of \u003ccode\u003eGoogle.Cloud.Diagnostics.Common.LoggingExtensions\u003c/code\u003e methods instead.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits from \u003ccode\u003eObject\u003c/code\u003e and includes inherited members like \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, \u003ccode\u003eMemberwiseClone\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGoogle.Cloud.Diagnostics.AspNetCore\u003c/code\u003e namespace and \u003ccode\u003eGoogle.Cloud.Diagnostics.AspNetCore.dll\u003c/code\u003e assembly are used for this functionality, offering integration with Google Cloud's logging service.\u003c/p\u003e\n"]]],[],null,["# Class GoogleLoggerFactoryExtensions (4.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.4.0 (latest)](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLoggerFactoryExtensions)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/4.3.1/Google.Cloud.Diagnostics.AspNetCore.GoogleLoggerFactoryExtensions) \n\n [Obsolete(\"Use Google.Cloud.Diagnostics.Common.LoggingExtensions methods instead.\")]\n public static class GoogleLoggerFactoryExtensions\n\nExtensions to add [GoogleLoggerProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLoggerProvider)s to an [ILoggerFactory](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.iloggerfactory). \n\nInheritance\n-----------\n\n[Object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GoogleLoggerFactoryExtensions \n\nInherited Members\n-----------------\n\n[Object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode#system-object-gethashcode) \n[Object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype#system-object-gettype) \n[Object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone#system-object-memberwiseclone) \n[Object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring#system-object-tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Diagnostics.AspNetCore](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore)\n\nAssembly\n--------\n\nGoogle.Cloud.Diagnostics.AspNetCore.dll\n\nRemarks\n-------\n\nLogs to Google Cloud Logging.\nDocs: \u003chttps://cloud.google.com/logging/docs/\u003e\n\nMethods\n-------\n\n### AddGoogle(ILoggerFactory, LogTarget, IServiceProvider, LoggerOptions, LoggingServiceV2Client)\n\n [Obsolete(\"Use Google.Cloud.Diagnostics.Common.LoggingExtensions methods instead.\")]\n public static ILoggerFactory AddGoogle(this ILoggerFactory factory, LogTarget logTarget, IServiceProvider serviceProvider, LoggerOptions options = null, LoggingServiceV2Client client = null)\n\nAdds a [GoogleLoggerProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLoggerProvider) for [GoogleLogger](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLogger)s.\n\n### AddGoogle(ILoggerFactory, IServiceProvider, String, LoggerOptions, LoggingServiceV2Client)\n\n [Obsolete(\"Use Google.Cloud.Diagnostics.Common.LoggingExtensions methods instead.\")]\n public static ILoggerFactory AddGoogle(this ILoggerFactory factory, IServiceProvider serviceProvider, string projectId = null, LoggerOptions options = null, LoggingServiceV2Client client = null)\n\nAdds a [GoogleLoggerProvider](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLoggerProvider) for [GoogleLogger](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLogger)s.\n\nSee Also\n--------\n\n[GoogleLogger](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.GoogleLogger)"]]