Skip to main content

logs

Creates, updates, deletes, gets or lists a logs resource.

Overview

Namelogs
TypeResource
Idgoogle.logging.logs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_buckets_views_logs_listselectprojectsId, locationsId, bucketsId, viewsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
organizations_locations_buckets_views_logs_listselectorganizationsId, locationsId, bucketsId, viewsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
folders_locations_buckets_views_logs_listselectfoldersId, locationsId, bucketsId, viewsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
billing_accounts_locations_buckets_views_logs_listselectbillingAccountsId, locationsId, bucketsId, viewsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
logs_listselectparentType, parentresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
projects_logs_listselectprojectsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
organizations_logs_listselectorganizationsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
folders_logs_listselectfoldersIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
billing_accounts_logs_listselectbillingAccountsIdresourceNames, pageSize, pageTokenLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
projects_logs_deletedeleteprojectsId, logsIdDeletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.
organizations_logs_deletedeleteorganizationsId, logsIdDeletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.
folders_logs_deletedeletefoldersId, logsIdDeletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.
billing_accounts_logs_deletedeletebillingAccountsId, logsIdDeletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.
logs_deletedeletelogNameDeletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
billingAccountsIdstring
bucketsIdstring
foldersIdstring
locationsIdstring
logNamestring
logsIdstring
organizationsIdstring
parentstring
parentTypestring
projectsIdstring
viewsIdstring
pageSizeinteger (int32)
pageTokenstring
resourceNamesstring

SELECT examples

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

SELECT
*
FROM google.logging.logs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND bucketsId = '{{ bucketsId }}' -- required
AND viewsId = '{{ viewsId }}' -- required
AND resourceNames = '{{ resourceNames }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';

DELETE examples

Deletes all the log entries in a log for the global _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

DELETE FROM google.logging.logs
WHERE projectsId = '{{ projectsId }}' --required
AND logsId = '{{ logsId }}' --required;