[[["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 latest version of GoogleLogger is 5.2.0, with previous versions listed including 5.1.0, 5.0.0, 4.4.0, and 4.3.1.\u003c/p\u003e\n"],["\u003cp\u003eGoogleLogger is a class that implements the ILogger interface for Google Cloud Logging.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetGcpConsoleLogsUrl\u003c/code\u003e method returns the URL to view the log entries on the Google Cloud Logging Console.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLog<TState>\u003c/code\u003e method logs an entry with a specified log level, event ID, state, exception, and formatter.\u003c/p\u003e\n"],["\u003cp\u003eThere are several extension methods available for adding or managing labels, which are accessible through ILoggerExtensions, to provide additional context to log entries.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Diagnostics.Common - Class GoogleLogger (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.GoogleLogger)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.GoogleLogger)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.GoogleLogger)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.GoogleLogger)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.GoogleLogger)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.GoogleLogger) \n\n public sealed class GoogleLogger : ILogger\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common class GoogleLogger.\n\n[ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) for Google Cloud Logging. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GoogleLogger \n\nImplements\n----------\n\n[ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) \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.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### BeginScope\\\u003cTState\\\u003e(TState)\n\n public IDisposable BeginScope\u003cTState\u003e(TState state)\n\nBegins a logical operation scope.\n\n### GetGcpConsoleLogsUrl()\n\n public Uri GetGcpConsoleLogsUrl()\n\nFor diagnostic purposes. Builds and returns the URL where the entries logged by\nthis [GoogleLogger](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.GoogleLogger) can be seen on the Google Cloud Logging Console.\n\n### IsEnabled(LogLevel)\n\n public bool IsEnabled(LogLevel logLevel)\n\nChecks if the given `logLevel` is enabled.\n\n### Log\\\u003cTState\\\u003e(LogLevel, EventId, TState, Exception, Func\\\u003cTState, Exception, string\\\u003e)\n\n public void Log\u003cTState\u003e(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func\u003cTState, Exception, string\u003e formatter)\n\nWrites a log entry.\n\nExtension Methods\n-----------------\n\n[ILoggerExtensions.WithAddedLabels(ILogger, IEnumerable\\\u003cKeyValuePair\\\u003cstring, string\\\u003e\\\u003e)](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILoggerExtensions#Google_Cloud_Diagnostics_Common_ILoggerExtensions_WithAddedLabels_Microsoft_Extensions_Logging_ILogger_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair_System_String_System_String___) \n[ILoggerExtensions.WithAddedLabels(ILogger, params KeyValuePair\\\u003cstring, string\\\u003e\\[\\])](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILoggerExtensions#Google_Cloud_Diagnostics_Common_ILoggerExtensions_WithAddedLabels_Microsoft_Extensions_Logging_ILogger_System_Collections_Generic_KeyValuePair_System_String_System_String____) \n[ILoggerExtensions.WithLabels(ILogger, IEnumerable\\\u003cKeyValuePair\\\u003cstring, string\\\u003e\\\u003e)](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILoggerExtensions#Google_Cloud_Diagnostics_Common_ILoggerExtensions_WithLabels_Microsoft_Extensions_Logging_ILogger_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair_System_String_System_String___) \n[ILoggerExtensions.WithLabels(ILogger, params KeyValuePair\\\u003cstring, string\\\u003e\\[\\])](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ILoggerExtensions#Google_Cloud_Diagnostics_Common_ILoggerExtensions_WithLabels_Microsoft_Extensions_Logging_ILogger_System_Collections_Generic_KeyValuePair_System_String_System_String____)"]]