# Troubleshoot secure gateway issues

This document provides information about how to use Google Cloud access logs
to resolve common issues with secure gateways.

Google Cloud access logs are a valuable tool for diagnosing problems.
You can view the access logs in the
[Logs Explorer](https://console.cloud.google.com/logs/query). To view logs for
troubleshooting secure gateway problems,
[configure Data Access audit logs for the `BeyondCorp Enterprise API`](https://docs.cloud.google.com/logging/docs/audit/configure-data-access#config-console).

## End user access

Google Cloud access logs provide valuable insights into user access patterns
and can help you troubleshoot access denial errors. These logs record both
successful and denied access attempts, offering a comprehensive view of user
interactions with your applications. In cases of denied access, the logs include
detailed information about the reasons for denial, such as the specific access
levels that were not met.

The logs also contain metadata, such as timestamps, user identities, and
resource details, providing further context for analysis and troubleshooting.
To filter the logs relevant to secure gateway access, use the following
filter:

    resource.type="audited_resource"
    resource.labels.method="AuthorizeUser"
    resource.labels.service="beyondcorp.googleapis.com"

## Secure gateway resource issues

If you encounter issues while managing secure gateway resources, such as
during creation, updating, or deletion, you can view the logs relevant to
secure gateway resource management by using the following filter:

    resource.type="audited_resource"
    resource.labels.service="beyondcorp.googleapis.com"

## Secure gateway connection issues

If you encounter issues while connecting to secure gateway resources, you can
enable [secure gateway logging](https://docs.cloud.google.com/chrome-enterprise-premium/docs/manage-security-gateway#enable-gateway-logging)
and view the connection logs relevant to secure gateway resource management by
using the following filter:

    resource.type="beyondcorp.googleapis.com/SecurityGateway"