Cloud Logging for the Google Home ecosystem

Cloud-to-cloud    Matter

You can access event logs for your integrations from Google Cloud Logging. Use Cloud Logging to explore logs, create metrics and alerts, or export logs to other applications using Google Cloud Pub/Sub.

Access Logging

To access Cloud Logging from the Google Cloud Console, click View all products, then go to Operations > Logging.

Go to Cloud Logging

Access to logging data is managed through Identity and Access Management (IAM) for users of your Actions project. For more details on roles and permissions for logging data, see Cloud Logging access control.

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 provides the following resource types:

Resource Type Display Name Description Labels
assistant_action_project Google Assistant Action Project A container for the Google Cloud Project associated with an Assistant Action.
  • project_id: The identifier of your current project that's associated with this resource, for example my-project.

Event logs

Cloud-to-cloud projects support the following events in Cloud Logging:

Cloud Logging Resource Event
Google Assistant Action Project SYNC intent errors
QUERY intent errors
EXECUTE intent errors
Notifications errors
Account linking errors
Local Home SDK HandlerError

Sync logs

The table below lists the schema of a syncLog entry:

Property Description
requestId Smart home intent request ID.
httpLatencyMsec Elapsed time before a response was received.
status Indicates the status of the intent response.

Execution logs

The table below lists the schema of an executionLog entry:

Property Description
requestId Unique request ID, for example 5325511189174727525.
latencyMsec Elapsed time before a response was received, for example, 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:

Property Description
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 projects are set to receive error logs by default, and it is possible for developers to opt-in to receive success logs as well. This is especially useful during the development phase when you plan to capture all logs from a few agents. Additional charges may apply to your project if you exceed the logging quota.

You can control the log level for your project by:

  1. In the Actions on Google Console, go to the Projects page.

    Go to the Actions on Google console

  2. Select your smart home project.

  3. Choose the Develop tab, and click Actions on the side bar.

  4. Select All in the Log control ingestion dropdown list.

Log exclusions

Developers can create log exclusions using logging query language to further customize their logs in a more flexible way. Logging query language is also used by Logs Explorer so you can use Logs Explorer to help create queries.

You can follow the steps for creating exclusion filters at this guide (configure the exclusion filter for the _Default sink).

Log-based metrics

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: