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

public sealed class GoogleLogger : ILogger

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

ILogger for Google Cloud Logging.

Inheritance

object > GoogleLogger

Implements

ILogger

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

BeginScope<TState>(TState)

public IDisposable BeginScope<TState>(TState state)
Parameter
NameDescription
stateTState
Returns
TypeDescription
IDisposable
Type Parameter
NameDescription
TState

GetGcpConsoleLogsUrl()

public Uri GetGcpConsoleLogsUrl()

For diagnostic purposes. Builds and returns the URL where the entries logged by this GoogleLogger can be seen on the Google Cloud Logging Console.

Returns
TypeDescription
Uri

IsEnabled(LogLevel)

public bool IsEnabled(LogLevel logLevel)
Parameter
NameDescription
logLevelLogLevel
Returns
TypeDescription
bool

Log<TState>(LogLevel, EventId, TState, Exception, Func<TState, Exception, string>)

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Parameters
NameDescription
logLevelLogLevel
eventIdEventId
stateTState
exceptionException
formatterFuncExceptionstring
Type Parameter
NameDescription
TState

Extension Methods