[Obsolete("Use Google.Cloud.Diagnostics.Common.GoogleLoggerProvider instead.")]
public sealed class GoogleLoggerProvider : ILoggerProvider, IDisposableILoggerProvider for Google Cloud Logging.
Namespace
Google.Cloud.Diagnostics.AspNetCoreAssembly
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 | |
|---|---|
| Name | Description |
logTarget |
LogTargetWhere to log to. Must not be null. |
serviceProvider |
IServiceProviderOptional, 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 |
LoggerOptionsOptional, options for the logger. |
client |
LoggingServiceV2ClientOptional, 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 |
IServiceProviderThe service provider to resolve additional services from. May be null, in which case additional services (such as custom labels) will not be used. |
projectId |
StringOptional 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 |
LoggerOptionsOptional, options for the logger. |
client |
LoggingServiceV2ClientOptional, 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 |
StringThe 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()