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:

NameDatatypeDescription

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
billing_accounts_locations_buckets_views_logs_listselectbillingAccountsId, locationsId, bucketsId, viewsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
folders_locations_buckets_views_logs_listselectfoldersId, locationsId, bucketsId, viewsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
organizations_locations_buckets_views_logs_listselectorganizationsId, locationsId, bucketsId, viewsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
projects_locations_buckets_views_logs_listselectprojectsId, locationsId, bucketsId, viewsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
logs_listselectparentType, parentpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
billing_accounts_logs_listselectbillingAccountsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
folders_logs_listselectfoldersIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
organizations_logs_listselectorganizationsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
projects_logs_listselectprojectsIdpageSize, pageToken, resourceNamesLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
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.
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.
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.
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.
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 billingAccountsId = '{{ billingAccountsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND bucketsId = '{{ bucketsId }}' -- required
AND viewsId = '{{ viewsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND resourceNames = '{{ resourceNames }}'
;

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 billingAccountsId = '{{ billingAccountsId }}' --required
AND logsId = '{{ logsId }}' --required
;