查看日志
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本主题介绍如何使用 Google Cloud 控制台中的日志浏览器或者使用 kubectl logs
命令查看日志数据。
在 Logs Explorer 中查看日志
本部分介绍了如何在 Logs Explorer 中或直接使用 kubectl
查看 Apigee Hybrid 日志。
如果您在 GKE 或 Anthos GKE 上,日志会自动发送到 Cloud Logging。
在 Logs Explorer 中查看日志:
-
在 Google Cloud 控制台中,转到 Logs Explorer 页面。
前往 Logs Explorer
在资源类型下拉列表中,选择 Kubernetes 容器、集群名称和命名空间 ID。
如需了解详情,请参阅在 Google Cloud 控制台中查看日志的文档。
以下示例显示了 Logs Explorer 中的混合日志输出:

直接查看日志文件
您可以直接使用 kubectl
查看写入每个 pod 文件系统的日志,如下所示:
kubectl logs pod_name -n namespace
例如:
kubectl logs apigee-mp-hybrid-docs-test-blue-6fb96f5b9-2k8hp -n my-namespace
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-14。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-02-14。"],[],[]]