参数
请参阅 插件通用配置 了解所有插件可用的配置选项。
auth_config
object
身份验证配置。必须提供
auth_config和auth_file中的至少一个。client_email
string
required
Google Cloud 服务账户的电子邮件地址。
private_key
string
required
Google Cloud 服务账户的私钥。
project_id
string
required
Google Cloud 服务账户中的项目 ID。
token_uri
string
required
default:
https://oauth2.googleapis.com/tokenGoogle Cloud 服务账户的令牌 URI。
entries_uri
string
default:
https://logging.googleapis.com/v2/entries:writeGoogle Cloud Logging 服务 API。
scope
array[string]
default:
["https://www.googleapis.com/auth/logging.read", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/cloud-platform"]Google Cloud 服务账户的访问范围。请参阅 Google API 的 OAuth 2.0 范围。
auth_file
string
Google Cloud 服务账户身份验证 JSON 文件的路径。必须提供
auth_config和auth_file中的至少一个。ssl_verify
boolean
default:
true如果设置为 true,验证服务器的 SSL 证书。
resource
object
default:
{"type": "global"}Google 监控资源,由
type和可选的labels组成,例如:{ "type": "gce_instance", "labels": { "project_id": "my-project", "instance_id": "12345678901234", "zone": "us-central1-a" } }有关更多详细信息,请参阅 MonitoredResource。
log_id
log_format
object
使用 JSON 格式的键值对自定义日志格式。值可以引用内置变量。
从 APISIX 3.15.0 开始,日志格式支持最多 5 层深度的嵌套结构。在 API7 企业版中,仅支持扁平的键值对结构,暂不支持嵌套结构。
你也可以通过配置 Plugin Metadata 来全局配置日志格 式,这将对所有
google-cloud-logging插件实例生效。如果单个插件实例配置的日志格式与插件元数据中配置的日志格式不同,则单个插件实例的配置优先级更高。有关更多详细信息,请参阅示例。name
string
default:
google-cloud-logging批处理器的唯一标识符。如果你使用 Prometheus 监控 APISIX 指标,该名称将导出在
apisix_batch_process_entries中。batch_max_size
integer
default:
1000vaild vaule:
大于 0
每一批次允许的最大日志条目数。一旦达到该数值,批次将被发送到日志服务。将此参数设置为 1 意味着立即处理。
inactive_timeout
integer
default:
5vaild vaule:
大于 0
在将批次发送到日志服务之前,等待新日志的最长时间(以秒为单位)。该值应小于
buffer_duration。buffer_duration
integer
default:
60vaild vaule:
大于 0
批次中最旧条目在发送到日志服务之前允许保留的最长时间(以秒为单位)。
retry_delay
integer
default:
1vaild vaule:
大于或等于 0
如果批次发送失败,重试发送到日志服务的时间间隔(以秒为单位)。
max_retry_count
integer
default:
60vaild vaule:
大于或等于 0
在丢弃日志条目之前允许的最大失败重试次数。