[Obsolete("Use Google.Cloud.Diagnostics.Common.GoogleLoggerProvider instead.")]
public sealed class GoogleLoggerProvider : ILoggerProvider, IDisposable
ILoggerProvider for Google Cloud Logging.
Namespace
Google.Cloud.Diagnostics.AspNetCore3Assembly
Google.Cloud.Diagnostics.AspNetCore3.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 | |
---|---|
Name | Description |
logTarget | LogTarget Where to log to. Must not be null. |
serviceProvider | IServiceProvider 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. |
options | LoggerOptions Optional, options for the logger. |
client | LoggingServiceV2Client Optional, logging client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
serviceProvider | IServiceProvider The service provider to resolve additional services from. May be null, in which case additional services (such as custom labels) will not be used. |
projectId | String 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. |
options | LoggerOptions Optional, options for the logger. |
client | LoggingServiceV2Client Optional, logging client. |
Returns | |
---|---|
Type | Description |
GoogleLoggerProvider |
CreateLogger(String)
public ILogger CreateLogger(string logName)
Creates a GoogleLogger with the given log name.
Parameter | |
---|---|
Name | Description |
logName | String The name of the log. This will be combined with the log location (LogTarget) to generate the resource name for the log. |
Returns | |
---|---|
Type | Description |
ILogger |
Dispose()
public void Dispose()