This document describes how to configure Gemini Code Assist Standard and Enterprise logging for a project by using the Google Cloud console or an API.
Limitations
Gemini Code Assist Standard and Enterprise log data recording is limited to user interactions with Gemini Code Assist within an IDE.
By default, Gemini Code Assist logs are collected on a per-project basis. For instructions on how to configure a centralized project to collect logs from multiple projects, see Set up multi-project logging.
Gemini Code Assist on GitHub doesn't support logging with Cloud Logging.
Before you begin
Verify that your Google Cloud project is attached to a billing account.
Verify IAM permissions
To configure Gemini Code Assist logging, you need specific IAM permissions. To follow the principle of least privilege, grant a custom role that contains only the necessary permissions.
Ask your administrator to create a custom role that includes the following permissions:
serviceusage.services.enable—to enable APIs for your project.cloudaicompanion.loggingSettings.create—to create logging settings.cloudaicompanion.loggingSettings.get—to view logging settings.cloudaicompanion.loggingSettings.list—to list logging settings.cloudaicompanion.loggingSettings.update—to update logging settings.cloudaicompanion.loggingSettingBindings.create—to bind logging settings to a project.cloudaicompanion.loggingSettingBindings.get—to view logging setting bindings.cloudaicompanion.loggingSettingBindings.list—to list logging setting bindings.
Alternatively, you can grant the predefined roles
Gemini for Google Cloud Settings Admin
(roles/cloudaicompanion.settingsAdmin) and
Service Usage Admin
(roles/serviceusage.serviceUsageAdmin). However, these roles include
permissions to configure other Gemini administrator settings in
Google Cloud and manage service usage in Google Cloud, which might
be more than needed to configure logging settings.
Configure Gemini Code Assist logging
The following sections provide steps required to enable the collection and storage of Gemini Code Assist Standard and Enterprise activity in Cloud Logging, including:
Gemini Code Assist Standard and Enterprise prompts and response logs, such as user input, contextual information, and responses.
Gemini Code Assist Standard and Enterprise metadata logs, such as telemetry metadata and lines of code accepted by the user.
For more details on both types of logs, see View Gemini Code Assist logs.
Enable logging for Gemini Code Assist in a project
Select one of the following options:
Console
Verify that you have enabled the Cloud Logging API in the project.