public sealed class LoggingOptions
Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class LoggingOptions.
Options for a GoogleLogger". These are options to configure when and what is logged, as where LoggingServiceOptions configure the logging service, including the target GCP project, etc.
Namespace
GoogleCloudGoogle.Cloud.DiagnosticsCommonAssembly
Google.Cloud.Diagnostics.Common.dll
Properties
BufferOptions
public BufferOptions BufferOptions { get; }
The buffer options for the logger.
Property Value | |
---|---|
Type | Description |
BufferOptions |
Labels
public Dictionary<string, string> Labels { get; }
Custom labels for log entries.
Property Value | |
---|---|
Type | Description |
Dictionarystringstring |
Keys and values added to Labels should not be null. If they are, an exception will be thrown when attempting to log an entry. The entry won't be logged and the exception will be propagated depending on the value of ExceptionHandling.
LogLevel
public LogLevel LogLevel { get; }
The minimum log level.
Property Value | |
---|---|
Type | Description |
LogLevel |
LogName
public string LogName { get; }
The name for the logs.
Property Value | |
---|---|
Type | Description |
string |
MonitoredResource
public MonitoredResource MonitoredResource { get; }
The monitored resource. See: https://cloud.google.com/logging/docs/api/v2/resource-list
Property Value | |
---|---|
Type | Description |
MonitoredResource |
RetryOptions
public RetryOptions RetryOptions { get; }
The retry options for the logger.
Property Value | |
---|---|
Type | Description |
RetryOptions |
Methods
Create(LogLevel, string, Dictionary<string, string>, MonitoredResource, BufferOptions, RetryOptions)
public static LoggingOptions Create(LogLevel logLevel = LogLevel.Information, string logName = null, Dictionary<string, string> labels = null, MonitoredResource monitoredResource = null, BufferOptions bufferOptions = null, RetryOptions retryOptions = null)
Create a new instance of LoggingOptions.
Parameters | |
---|---|
Name | Description |
logLevel | LogLevel Optional, the minimum log level. Defaults to Information |
logName | string Optional, the name of the log. Defaults to 'aspnetcore'. |
labels | Dictionarystringstring Optional, custom labels to be added to log entries.
Keys and values added to |
monitoredResource | MonitoredResource Optional, the monitored resource. The monitored resource will be automatically detected if it is not set and will default to the global resource if the detection fails. See: https://cloud.google.com/logging/docs/api/v2/resource-list |
bufferOptions | BufferOptions Optional, the buffer options. Defaults to a Timed |
retryOptions | RetryOptions Optional, the retry options. Defaults to a None |
Returns | |
---|---|
Type | Description |
LoggingOptions |