> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ewake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GCP Cloud Logging

> Connect GCP Cloud Logging to let ewake query your application and infrastructure logs for incident investigation.

<Info>
  **What you'll get:** ewake can query your GCP Cloud Logging logs in real time, correlating log entries with alerts, deployments, and infrastructure events across your Google Cloud projects.
</Info>

***

## Prerequisites

* A Google Cloud project with logs flowing into Cloud Logging
* **Owner or IAM Admin** access to create a service account and assign roles
* Access to your ewake dashboard

***

## Configuration

<Steps>
  <Step title="Create a Service Account">
    In the [GCP Console](https://console.cloud.google.com), go to **IAM & Admin** → **Service Accounts** → click **Create Service Account**.

    Give it a name (e.g. `ewake-logs`) and click **Create and continue**.
  </Step>

  <Step title="Grant the logging.viewer role">
    In the **Grant this service account access to project** step, assign the role:

    | Role                                   | Why                                                               |
    | -------------------------------------- | ----------------------------------------------------------------- |
    | `Logs Viewer` (`roles/logging.viewer`) | **Required.** Read-only access to all log entries in the project. |

    Click **Continue**, then **Done**.

    <Note>
      `Logs Viewer` is read-only. Ewake cannot write, delete, or modify any log entries or logging configuration.
    </Note>
  </Step>

  <Step title="Generate a JSON key">
    Open the service account you just created → go to the **Keys** tab → click **Add Key** → **Create new key** → select **JSON** → click **Create**.

    A `.json` file will be downloaded to your machine. Keep it safe, it contains the credentials ewake will use.

    <Note>
      If you lose this key, you can revoke it and generate a new one from the same Keys tab. Never commit the JSON file to source control.
    </Note>
  </Step>

  <Step title="Connect in ewake">
    In your ewake dashboard, go to **Integrations** → **GCP Cloud Logging** → click **Configure**.

    Fill in the following fields:

    | Field                    | Value                                                   |
    | ------------------------ | ------------------------------------------------------- |
    | **Project ID**           | Your GCP project ID (e.g. `my-project-123456`)          |
    | **Service Account JSON** | Paste the full contents of the downloaded JSON key file |
  </Step>

  <Step title="Save">
    Click **Connect**.

    <Check>
      GCP Cloud Logging is connected. Ewake can now query your logs during investigations.
    </Check>
  </Step>
</Steps>

***

<Note>
  Ewake only requires **read access** to GCP Cloud Logging. It never writes logs, modifies sinks, or changes any IAM policies in your project.
</Note>
