Cloud Logging 字段定义

启用 Cloud Audit Logs 后, Google Cloud 控制台日志浏览器会记录以下类别的内容:

  • AuditLog proto
  • API 级日志

启用和查看

借助 Cloud Audit Logs,您可以查看资源中的管理活动和权限。 Google Cloud

启用日志记录

请按照以下步骤启用日志。

  1. 前往 Google Cloud 控制台,依次选择 IAM 和管理 > 审核日志
  2. 数据访问审核日志配置输入 Dialogflow API 过滤条件,然后选择以下 API 类型:管理员读取数据读取数据写入

查看日志

您必须获得项目所有者私密日志查看者 IAM 角色,然后按照以下步骤查看日志。

  1. 前往 Google Cloud 控制台,然后依次选择 Logging > Logs Explorer
  2. 可选:在 Logs Explorer 中,根据需要添加过滤条件或调整时间轴。
  3. 选择条目以查看详情。

日志记录 proto

每个日志条目都将是 AuditLog proto 的实例,其中包含以下字段:

字段类型 字段名称
字符串 service_name
字符串 method_name
字符串 资源名称
ResourceLocation resource_location
  • current_locations
  • original_locations
google.protobuf.Struct resource_original_state
int64 num_response_items
google.rpc.Status 状态
AuthenticationInfo authentication_info
  • principal_email
  • 主账号
  • authority_selector
  • third_party_principal
  • service_account_key_name
  • service_account_delegation_info
  • service_account_delegation_session_id
  • principal_subject
  • service_delegation_history
重复的 AuthorizationInfo authorization_info
  • authorization_logging_options
  • resource_attributes
  • admin_access_control_authorization_info
  • permission_type
    • ADMIN_READ
    • ADMIN_WRITE
    • DATA_READ
    • DATA_WRITE
  • impersonation_peer_borg_role
PolicyViolationInfo policy_violation_info
重复的 PolicyViolationInfo policy_violations
RequestMetadata request_metadata
  • caller_ip
  • caller_supplied_user_agent
  • caller_network
  • caller_location
  • caller_region_code
  • caller_internal_gce_vnid
  • caller_gce_network_project_number
  • caller_is_gce_client
  • request_attributes
  • destination_attributes
google.protobuf.Struct 请求
google.protobuf.Struct 回答
google.protobuf.Struct 元数据
字节 audit_loggable_mint
字节 loggable_ubermint
字节 audit_loggable_service_control_token
隐去 隐去内容
  • type
    • 已清除
    • 已替换
    • FAILED_TO_PROVIDE
    • NOT_REQUIRED
    • 部分
  • 字段
  • reason

根据启用的 Cloud Audit Logs 字段,日志浏览器会将 API 的请求和响应正文填充到日志记录 proto 的请求和响应字段中。

API 级别记录的字段

API 已记录的字段
AnalyzeContent 请求
  • 参与者
StreamingAnalyzeContent 请求
  • 参与者
响应
  • speech_model
CreateConversation 请求
  • 父级
  • 对话
    • conversation_profile
响应
  • conversation_profile
  • lifecycle_state
  • name
  • start_time
CreateParticipant 请求
  • 父级
  • 参与者
    • 角色
响应
  • name
  • 角色
SuggestConversationSummary 请求
  • 对话
响应
  • latest_message
  • answer_record
SearchKnowledge 请求
  • 父级
  • conversation_profile
  • 对话
  • latest_message
响应
  • answer_record
SuggestKnowledgeAssist 请求
  • 父级
  • latest_message
响应
  • latest_message
  • answer_record