Class GoogleLoggerProvider (4.4.0)

[Obsolete("Use Google.Cloud.Diagnostics.Common.GoogleLoggerProvider instead.")]
public sealed class GoogleLoggerProvider : ILoggerProvider, IDisposable

ILoggerProvider for Google Cloud Logging.

Inheritance

Object > GoogleLoggerProvider

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

Methods

Create(LogTarget, IServiceProvider, LoggerOptions, LoggingServiceV2Client)

public static GoogleLoggerProvider Create(LogTarget logTarget, IServiceProvider serviceProvider, LoggerOptions options = null, LoggingServiceV2Client client = null)

Create an ILoggerProvider for Google Cloud Logging.

Parameters
NameDescription
logTargetLogTarget

Where to log to. Must not be null.

serviceProviderIServiceProvider

Optional, the service provider to resolve additional services from. May be null, in which case additional services (such as custom labels) will not be used.

optionsLoggerOptions

Optional, options for the logger.

clientLoggingServiceV2Client

Optional, logging client.

Returns
TypeDescription
GoogleLoggerProvider

Create(IServiceProvider, String, LoggerOptions, LoggingServiceV2Client)

public static GoogleLoggerProvider Create(IServiceProvider serviceProvider, string projectId = null, LoggerOptions options = null, LoggingServiceV2Client client = null)

Create an ILoggerProvider for Google Cloud Logging.

Parameters
NameDescription
serviceProviderIServiceProvider

The service provider to resolve additional services from. May be null, in which case additional services (such as custom labels) will not be used.

projectIdString

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.

optionsLoggerOptions

Optional, options for the logger.

clientLoggingServiceV2Client

Optional, logging client.

Returns
TypeDescription
GoogleLoggerProvider

CreateLogger(String)

public ILogger CreateLogger(string logName)

Creates a GoogleLogger with the given log name.

Parameter
NameDescription
logNameString

The name of the log. This will be combined with the log location (LogTarget) to generate the resource name for the log.

Returns
TypeDescription
ILogger

Dispose()

public void Dispose()