Before you begin, verify that you have access to Cloud Logging. We recommend
the Logs Viewer (roles/logging.viewer) Identity and Access Management role.
For more information on Logging access, see Access control
with IAM.
The following describe how to verify and grant IAM access:
Grant a role to
relevant principals in your project.
Loggable actions
The following actions can be logged:
FIND: Finding work to do, such as listing files in a directory, listing
objects in a bucket, or listing managed folders in a bucket. Not supported for
agent-based transfers.
COPY: Copying files or objects to Cloud Storage.
DELETE: Deleting files or objects at the source or the destination. For
transfers between two file systems, also logs the deletion of files from the
intermediary Cloud Storage bucket.
Loggable states
For each action, you can choose to log one or more of the following states:
SUCCEEDED: The action was successful.
FAILED: The action failed.
SKIPPED: Only applies to the COPY action, and only supported for agent-based
transfer jobs. Must be set using gcloud or REST API. This state means that
the copy was skipped. This occurs when the file already exists in the sink,
and your transfer job is configured to ignore existing files.
Enable logging
To enable logging, specify the actions and the states to log.
gcloud CLI
When creating a transfer job with gcloud transfer jobs create, use the
following flags to enable logging:
Adjust loggingConfig to include the specific logActions and
logActionStates to log. For example, to log when copy and find actions fail,
provide the following loggingConfig:
The value is always
type.googleapis.com/google.storagetransfer.logging.TransferActivityLog.
action
Describes the action of this particular task. One of the following:
FIND: Finding work to do, such as listing files in a
directory or listing objects in a bucket. Not reported for
agent-based transfers.
COPY: Copying files or objects to Cloud Storage.
DELETE: Deleting files or objects at the source,
destination, or intermediary bucket.
findAction
Specifies whether the subject of the find action was an object or
a managed folder.
completeTime
The ISO 8601-compliant timestamp at which the operation completed.
destinationContainer
Only present for FIND operations.
FIND operations are not logged for agent-based transfers.
The destination container for this transfer. Contains two
sub-fields:
gcsBucket.bucket: The destination Cloud Storage
bucket name.
type: Always GCS.
destinationObject
Only present for COPY and DELETE
operations.
Information about the object at the destination. Contains two
sub-fields:
One of gcsObject, gcsManagedFolder, or
posixFile, depending on the destination. All options
contain multiple sub-fields that specify name, location, date/time
info, and the object or file's hash.
Information about the source object. Contains two sub-fields:
An entry specific to the source object's host. The field is named
according to the source type and contains subfields for metadata.
Possible fields are as follows.
The status of the action. If status.statusCode is
OK, the action succeeded. Otherwise, the action failed. The
status.errorType and status.errorMessage fields
are only populated if the status is not OK.
In addition, the top-level resource field contains the following fields.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Logging for Storage Transfer Service\n\nThis page describes how to configure and view Cloud Logging for\nStorage Transfer Service logs.\n\nCloud Logging for Storage Transfer Service is supported for all transfers. `FIND`\noperations are not logged for agent-based transfers.\n\nFile system transfers can additionally configure\n[file system transfer logs](/storage-transfer/docs/on-prem-transfer-log-format).\n\nBefore you begin\n----------------\n\nBefore you begin, verify that you have access to Cloud Logging. We recommend\nthe **Logs Viewer (roles/logging.viewer)** Identity and Access Management role.\nFor more information on Logging access, see [Access control\nwith IAM](/logging/docs/access-control).\n\nThe following describe how to verify and grant IAM access:\n\n- [View current access](/iam/docs/granting-changing-revoking-access#view-access) to verify the access that each principal has.\n- [Grant a role](/iam/docs/granting-changing-revoking-access#single-role) to relevant principals in your project.\n\nLoggable actions\n----------------\n\nThe following actions can be logged:\n\n- `FIND`: Finding work to do, such as listing files in a directory, listing objects in a bucket, or listing managed folders in a bucket. Not supported for agent-based transfers.\n- `COPY`: Copying files or objects to Cloud Storage.\n- `DELETE`: Deleting files or objects at the source or the destination. For transfers between two file systems, also logs the deletion of files from the intermediary Cloud Storage bucket.\n\nLoggable states\n---------------\n\nFor each action, you can choose to log one or more of the following states:\n\n- `SUCCEEDED`: The action was successful.\n- `FAILED`: The action failed.\n- `SKIPPED`: Only applies to the COPY action, and only supported for agent-based transfer jobs. Must be set using `gcloud` or REST API. This state means that the copy was skipped. This occurs when the file already exists in the sink, and your transfer job is configured to ignore existing files.\n\nEnable logging\n--------------\n\nTo enable logging, specify the actions and the states to log. \n\n### gcloud CLI\n\nWhen creating a transfer job with `gcloud transfer jobs create`, use the\nfollowing flags to enable logging: \n\n gcloud transfer jobs create \u003cvar translate=\"no\"\u003eSOURCE\u003c/var\u003e \u003cvar translate=\"no\"\u003eDESTINATION\u003c/var\u003e \\\n --log-actions=copy,delete,find \\\n --log-action-states=succeeded,failed,skipped\n\nYou must specify at least one value for each flag.\n\n### REST\n\nTo create a logging configuration, use\n[`transferJobs.create`](/storage-transfer/docs/reference/rest/v1/transferJobs/create) with a\n[`LoggingConfig`](/storage-transfer/docs/reference/rest/v1/transferJobs#LoggingConfig): \n\n {\n \"name\":\"transferJobs/myFirstTransfer\",\n \"status\": \"ENABLED\",\n \"projectId\": \"test-id-001\",\n \"loggingConfig\": {\n \"logActions\": [\"FIND\", \"DELETE\", \"COPY\"],\n \"logActionStates\": [\"SUCCEEDED\", \"FAILED\", \"SKIPPED\"], #SKIPPED is only supported for agent-based transfers\n },\n \"transferSpec\": {\n \"awsS3DataSource\": {\n \"bucketName\": \"AWS_SOURCE_NAME\",\n \"awsAccessKey\": {\n \"accessKeyId\": \"AWS_ACCESS_KEY_ID\",\n \"secretAccessKey\": \"AWS_SECRET_ACCESS_KEY\"\n }\n },\n \"gcsDataSink\": {\n \"bucketName\": \"destination_bucket\",\n \"path\": \"foo/bar/\"\n },\n }\n }\n\nAdjust `loggingConfig` to include the specific `logActions` and\n`logActionStates` to log. For example, to log when copy and find actions fail,\nprovide the following `loggingConfig`: \n\n \"loggingConfig\": {\n \"logActions\": [\"COPY\", \"FIND\"],\n \"logActionStates\": [\"FAILED\"],\n }\n\nUpdate a logging configuration\n------------------------------\n\n### gcloud CLI\n\nTo update an existing job's logging configuration, use the appropriate\nflags with the [`gcloud transfer jobs update`](/sdk/gcloud/reference/transfer/jobs/update) command: \n\n gcloud transfer jobs update \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e \\\n --log-actions=copy,delete,find \\\n --log-action-states=succeeded,failed,skipped\n\nTo disable logging for this job, specify `--clear-log-config`: \n\n gcloud transfer jobs update \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e --clear-log-config\n\n### REST\n\nTo update an existing transfer job's logging configuration, use\n[`transferJobs.patch`](/storage-transfer/docs/reference/rest/v1/transferJobs/patch) with\n[`LoggingConfig`](/storage-transfer/docs/reference/rest/v1/transferJobs#LoggingConfig): \n\n {\n \"projectId\": \"test-id-001\",\n \"transferJob\": {\n \"loggingConfig\": {\n \"logActions\": [\"FIND\", \"DELETE\", \"COPY\"],\n \"logActionStates\": [\"SUCCEEDED\", \"FAILED\", \"SKIPPED\"], #SKIPPED is only supported for agent-based transfers\n },\n },\n \"updateTransferJobFieldMask\": \"loggingConfig\"\n }\n\nThe `updateTransferJobFieldMask` specifies the field that is being updated in\nthis request and is required.\n\nTo disable logging for this job, send a `loggingConfig` with empty lists for\n`logActions` and `logActionStates`: \n\n {\n \"projectId\": \"test-id-001\",\n \"transferJob\": {\n \"loggingConfig\": {\n \"logActions\": [],\n \"logActionStates\": [],\n },\n },\n \"updateTransferJobFieldMask\": \"loggingConfig\"\n }\n\nView logs\n---------\n\nTo view transfer logs, do the following: \n\n### Google Cloud console\n\n1. Go to the Google Cloud navigation menu\n *menu* and select\n **Logging \\\u003e Logs Explorer** :\n\n [Go to the Logs Explorer](https://console.cloud.google.com/logs/query)\n2. Select a Google Cloud project.\n\n3. From the **Upgrade** menu, switch from **Legacy Logs Viewer** to\n **Logs Explorer**.\n\n4. To filter your logs to show only Storage Transfer Service entries, type\n `storage_transfer_job` into the query field and click\n **Run query**.\n\n5. In the **Query results** pane, click **Edit time** to change the time\n period for which to return results.\n\nFor more information on using the Logs Explorer, see [Using the\nLogs Explorer](/logging/docs/view/logs-viewer-interface).\n\n### gcloud CLI\n\nTo use the gcloud CLI to search for Storage Transfer Service\nlogs, use the\n[`gcloud logging read`](/logging/docs/reference/tools/gcloud-logging#reading_log_entries)\ncommand.\n\nSpecify a filter to limit your results to Storage Transfer Service logs. \n\n gcloud logging read \"resource.type=storage_transfer_job\"\n\n### Cloud Logging API\n\nUse the [`entries.list`](/logging/docs/reference/v2/rest/v2/entries/list)\nCloud Logging API method.\n\nTo filter your results to include only Storage Transfer Service-related entries,\nuse the `filter` field. A sample JSON request object is below. \n\n {\n \"resourceNames\":\n [\n \"projects/\u003cvar translate=\"no\"\u003emy-project-name\u003c/var\u003e\"\n ],\n \"orderBy\": \"timestamp desc\",\n \"filter\": \"resource.type=\\\"storage_transfer_job\\\"\"\n }\n\nTransfer log format\n-------------------\n\nThe following section describes the fields for Storage Transfer Service logs.\n\nAll Storage Transfer Service-specific fields are contained within a\n`jsonPayload` object. \n\n### `FIND` actions\n\n {\n \"jsonPayload\": {\n \"@type\": \"type.googleapis.com/google.storagetransfer.logging.TransferActivityLog\",\n \"action\": \"FIND\",\n \"completeTime\": \"2021-12-16T18:58:49.344509695Z\",\n \"destinationContainer\": {\n \"gcsBucket\": {\n \"bucket\": \"my-bucket-2\",\n },\n \"type\": \"GCS\",\n },\n \"operation\": \"transferOperations/transferJobs-7876027868280507149--3019866490856027148\",\n \"sourceContainer\": {\n \"gcsBucket\": {\n \"bucket\": \"my-bucket-1\"\n },\n \"type\": \"GCS\"\n },\n \"status\": {\n \"statusCode\": \"OK\"\n }\n }\n }\n\n### `COPY` and `DELETE` actions\n\n {\n \"jsonPayload\": {\n \"@type\": \"type.googleapis.com/google.storagetransfer.logging.TransferActivityLog\",\n \"action\": \"COPY\",\n \"completeTime\": \"2021-12-16T18:59:00.510509049Z\",\n \"destinationObject\": {\n \"gcsObject\": {\n \"bucket\": \"my-bucket-2\",\n \"objectKey\": \"README.md\"\n },\n \"type\": \"GCS\",\n },\n \"operation\": \"transferOperations/transferJobs-7876027868280507149--3019866490856027148\",\n \"sourceObject\": {\n \"gcsObject\": {\n \"bucket\": \"my-bucket-1\",\n \"lastModifiedTime\": \"2021-12-07T16:41:09.456Z\",\n \"md5\": \"WgnCOIdfCXNTUDpQJSKb2w==\",\n \"objectKey\": \"README.md\",\n },\n \"type\": \"GCS\",\n },\n \"status\": {\n \"statusCode\": \"OK\"\n }\n }\n }\n\nIn addition, the top-level `resource` field contains the following fields. \n\n \"resource\": {\n \"labels\": {\n \"job_id\": \"transferJobs/7876027868280507149\"\n \"project_id\": \"my-project-id\"\n }\n \"type\": \"storage_transfer_job\"\n }"]]