LoggingConfig

Project level logging config to control what level of log will be generated and written to Cloud Logging.

JSON representation
{
  "name": string,
  "defaultLogGenerationRule": {
    object (LogGenerationRule)
  },
  "serviceLogGenerationRules": [
    {
      object (ServiceLogGenerationRule)
    }
  ]
}
Fields
name

string

Required. Immutable. The name of the LoggingConfig singleton resource. Format: projects/*/loggingConfig

defaultLogGenerationRule

object (LogGenerationRule)

The log generation rule that applies by default to all services supporting log generation. It can be overridden by ServiceLogGenerationRule for service level control.

serviceLogGenerationRules[]

object (ServiceLogGenerationRule)

Controls logging configurations more granularly for each supported service.

This overrides the defaultLogGenerationRule for the services specified. For those not mentioned, they will fallback to the default log generation rule.

LogGenerationRule

The logging configurations for services supporting log generation.

JSON representation
{
  "loggingLevel": enum (LoggingLevel),
  "infoLogSampleRate": number
}
Fields
loggingLevel

enum (LoggingLevel)

The logging level.

By default it is set to LOG_WARNINGS_AND_ABOVE.

infoLogSampleRate

number

The log sample rate for INFO level log entries. You can use this to reduce the number of entries generated for INFO level logs.

DO NOT set this field if the loggingLevel is not LoggingLevel.LOG_ALL. Otherwise, an INVALID_ARGUMENT error is returned.

Sample rate for INFO logs defaults to 1 when unset (generate and send all INFO logs to Cloud Logging). Its value must be greater than 0 and less than or equal to 1.

LoggingLevel

The setting to control log generation.

Enums
LOGGING_LEVEL_UNSPECIFIED Default value. Defaults to LOG_FOR_WARNINGS_AND_ABOVE if unset.
LOGGING_DISABLED No log will be generated and sent to Cloud Logging.
LOG_ERRORS_AND_ABOVE Log for operations resulted in fatal error.
LOG_WARNINGS_AND_ABOVE In addition to LOG_ERRORS_AND_ABOVE, also log for operations that have soft errors, quality suggestions.
LOG_ALL Log all operations, including successful ones.

ServiceLogGenerationRule

The granular logging configurations for supported services.

JSON representation
{
  "serviceName": string,
  "logGenerationRule": {
    object (LogGenerationRule)
  }
}
Fields
serviceName

string

Required. Supported service names: "CatalogService", "CompletionService", "ControlService", "MerchantCenterStreaming", "ModelService", "PredictionService", "ProductService", "ServingConfigService", "UserEventService",

logGenerationRule

object (LogGenerationRule)

The log generation rule that applies to this service.