Using the Logging API

For reference documentation for the API, see Logging API.

For sample code, including instructions for setting up client libraries, see Logging's Client Libraries. For additional code samples, see Writing and Managing Logs and Exporting Logs.

To try out the API, you can make calls right from your browser using the APIs Explorer. For a command-line interface to the Logging API, see gcloud logging command.

Setup tasks

For instructions on setting up client libraries and authorizing the Logging API, with sample code, see Logging API Client Libraries.

客户端库可以使用应用默认凭据轻松进行 Google API 身份验证,并向这些 API 发送请求。借助应用默认凭据,您可以在本地测试应用并部署它,无需更改底层代码。如需了解详情(包括代码示例),请参阅 Google Cloud Platform 身份验证指南

You can restrict how much access your application has to Logging data by using Identity and Access Management permissions and roles. For more information, see Logging Access Control Guide.