Skip to content

Cloud Logging API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

Writes log entries and manages your Cloud Logging configuration.

Cloud Logging API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 39 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://logging.googleapis.com/
Version
v2
Endpoints
39
Spec updated
2023-04-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://logging.googleapis.com/v2/monitoredResourceDescriptors" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://logging.googleapis.com/v2/monitoredResourceDescriptors", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://logging.googleapis.com/v2/monitoredResourceDescriptors",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
POST/v2/entries:copyCopies a set of log entries from a log bucket to a Cloud Storage bucket.
POST/v2/entries:listLists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, s
POST/v2/entries:tailStreaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.
POST/v2/entries:writeWrites log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent
GET/v2/monitoredResourceDescriptorsLists the descriptors for monitored resource types used by Logging.
DELETE/v2/{logName}Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete op
GET/v2/{metricName}Gets a logs-based metric.
PUT/v2/{metricName}Creates or updates a logs-based metric.
DELETE/v2/{metricName}Deletes a logs-based metric.
GET/v2/{name}Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
PATCH/v2/{name}Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is
DELETE/v2/{name}Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs,
GET/v2/{name}/cmekSettingsGets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and bill
PATCH/v2/{name}/cmekSettingsUpdates the Log Router CMEK settings for the given resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once
GET/v2/{name}/locationsLists information about the supported locations for this service.
GET/v2/{name}/operationsLists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.
GET/v2/{name}/settingsGets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing a
PATCH/v2/{name}/settingsUpdates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once c
POST/v2/{name}:cancelStarts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the serv
POST/v2/{name}:undeleteUndeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.
POST/v2/{name}:updateAsyncUpdates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been c
GET/v2/{parent}/bucketsLists log buckets.
POST/v2/{parent}/bucketsCreates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.
POST/v2/{parent}/buckets:createAsyncCreates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.
GET/v2/{parent}/exclusionsLists all the exclusions on the _Default sink in a parent resource.
POST/v2/{parent}/exclusionsCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10
GET/v2/{parent}/linksLists links.
POST/v2/{parent}/linksAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currentl
GET/v2/{parent}/logsLists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
GET/v2/{parent}/metricsLists logs-based metrics.
POST/v2/{parent}/metricsCreates a logs-based metric.
GET/v2/{parent}/sinksLists sinks.
POST/v2/{parent}/sinksCreates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identi
GET/v2/{parent}/viewsLists views on a log bucket.
POST/v2/{parent}/viewsCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
GET/v2/{sinkName}Gets a sink.
PUT/v2/{sinkName}Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might als
PATCH/v2/{sinkName}Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might als
DELETE/v2/{sinkName}Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.

Questions

Does the Cloud Logging API API need an API key?

Yes. The Cloud Logging API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Cloud Logging API API support HTTPS?

Yes, the Cloud Logging API API is served over HTTPS.

How many endpoints does the Cloud Logging API API have?

Its OpenAPI description lists 39 endpoints in version v2. All of them are shown on this page.

What are alternatives to the Cloud Logging API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).