Вы можете получить доступ к журналам событий для ваших интеграций из Google Cloud Logging . Используйте Cloud Logging для просмотра журналов, создания метрик и оповещений или экспорта журналов в другие приложения с помощью Google Cloud Pub/Sub .
Журналирование доступа
Чтобы получить доступ к Cloud Logging из Google Cloud Console , нажмите «Просмотреть все продукты» , затем перейдите в раздел «Наблюдаемость» > «Ведение журналов» .
Доступ к данным журналов управляется системой управления идентификацией и доступом (IAM) для пользователей вашего проекта Actions. Более подробную информацию о ролях и разрешениях для доступа к данным журналов см. в разделе « Управление доступом к Cloud Logging».
Log entries are retained for 30 days per the Cloud Logging retention policy , then scheduled for deletion. You can also delete entries on demand by using the Logs Explorer interface.
You can learn more on how to use logs effectively in the Searching Logs section of the Troubleshooting guide .
Cloud Logging предоставляет следующие типы ресурсов:
| Тип ресурса | Отображаемое имя | Описание | Метки |
|---|---|---|---|
assistant_action_project | Проект действий Google Ассистента | Контейнер для проекта Google Cloud, связанный с действием Google Assistant. |
|
Журналы событий
В проектах Cloud-to-cloud в Cloud Logging поддерживаются следующие события:
| Ресурс по облачному логированию | Событие |
|---|---|
| Проект действий Google Ассистента | Ошибки намерения SYNC |
| QUERY intent errors | |
| Ошибки намерения ВЫПОЛНИТЬ | |
| Ошибки уведомлений | |
| Account linking errors | |
| Local Home SDK HandlerError |
Журналы синхронизации
The table below lists the schema of a syncLog entry:
| Свойство | Описание |
|---|---|
requestId | Идентификатор запроса намерения для умного дома. |
httpLatencyMsec | Elapsed time before a response was received. |
status | Indicates the status of the intent response. |
Журналы выполнения
The table below lists the schema of an executionLog entry:
| Свойство | Описание |
|---|---|
requestId | Unique request ID, for example 5325511189174727525 . |
latencyMsec | Время, прошедшее до получения ответа, например, 6000 . |
executionType | Transport used for the request, for example CLOUD or MATTER , depending on your integration. |
actionType | Optional indicator of the user action taken, for example QUERY or EXECUTE . For EXECUTE actions, includes the command issued to fulfillment for supported traits, for example ONOFF_OFF |
trait | Optional trait associated with this user action. |
deviceTypes | List of device types affected by the event, for example LIGHT . |
isSuccess | Whether the request received a successful response. |
fallbackToCloud | Whether the request routed to cloud fulfillment following an error from local fulfillment. |
statusType | Indicates the status of the intent response, such as SUCCESS , PENDING , or OFFLINE . For ERROR responses, this property contains the errorCode provided by the fulfillment. |
externalDebugString | Optional detailed debugging message associated with this user action. |
locale | Language code associated with the request. |
Notification logs
The table below lists the schema of a notificationLog entry:
| Свойство | Описание |
|---|---|
requestId | Notification request ID. |
structName | Name of the notification struct, such as "ObjectDetection". |
status | Indicates the status of the notification. |
Log level setting
В проектах, Cloud-to-cloud по умолчанию настроено получение журналов ошибок, однако разработчики могут дополнительно включить получение журналов успешных операций. Это особенно полезно на этапе разработки, когда планируется сбор всех журналов от нескольких агентов. За превышение квоты на ведение журналов может взиматься дополнительная плата.
You can control the log level for your project by:
In the Actions on Google Console , go to the Projects page.
Select your smart home project.
Choose the Develop tab, and click Actions on the side bar.
Select All in the Log control ingestion dropdown list.
Log exclusions
Разработчики могут создавать исключения для логов, используя язык запросов логирования , что позволяет более гибко настраивать отображение логов. Язык запросов логирования также используется в Logs Explorer, поэтому вы можете использовать Logs Explorer для создания запросов.
You can follow the steps for creating exclusion filters at this guide (configure the exclusion filter for the _Default sink).
Метрики на основе логов
Developers can use Log-based metrics to track and analyze patterns within their logs. It is also possible to create custom charts and set up alerts on log-based metrics.
To start using log-based metrics for smart home, check out creating a counter log-based metric guide .
Связанные ресурсы
To learn more about using Cloud Logging in your project, see the following documentation :
- Pricing : Details on allotments and overage costs.
- Quotas and limits : Details on limits and retention policies for logging usage.
- Advanced logs queries : Guide to using advanced expressions to query and analyze log data.