Dialogflow API requests and responses can optionally be logged to
[Cloud logging](https://docs.cloud.google.com/logging/docs)
for your agent.
You can also control the

[region](https://docs.cloud.google.com/dialogflow/cx/docs/concept/region)

in which these logs are stored.

## Enable Cloud logging

To enable or disable Cloud logging for your agent,
see the logging options in the

[agent's general settings](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent#settings-general).


## Viewing Cloud logs

Once you enable Cloud logging for an agent,
you can browse these logs using the
[Cloud Logs Explorer](https://docs.cloud.google.com/logging/docs/view/logs-explorer-interface).

## Log format

For detailed information on the log format, see
[Log entry structure](https://docs.cloud.google.com/logging/docs/api/platform-logs#structure).

The following is a partial list of log entry titles used by Dialogflow:

- Dialogflow Request
- Dialogflow Response
- Dialogflow webhook request
- Dialogflow webhook response
- Dialogflow webhook error

Request and response log entries have a `jsonPayload` field in the JSON format. The content of this payload resembles the structure of like-named Dialogflow API REST requests and responses as defined in [Dialogflow reference documentation](https://docs.cloud.google.com/dialogflow/cx/docs/reference).

## Regionalization

By default, Dialogflow Cloud log entries are routed to the
[_Default logs bucket](https://docs.cloud.google.com/logging/docs/buckets),
which is global.
If you have data residency requirements for your project,
you can route your logs to a region-specific logs bucket.
For instructions, see
[regionalizing your project's logs using logs buckets](https://docs.cloud.google.com/logging/docs/regionalized-logs).

> [!NOTE]
> **Note:** When redirecting log sinks, you can use  
> `LOG_ID("dialogflow-runtime.googleapis.com/requests")` for filtering Dialogflow Cloud logs.

## Limitations

If Dialogflow response exceeds the Cloud logging log entry size
[limit](https://docs.cloud.google.com/logging/quotas), the `QueryResult.diagnosticInfo` field is not included
in the logs.

At most 500 turns will be logged for each conversation.