Method: entries.tail

Streaming read of log entries as they are received. Until the stream is terminated, it will continue reading logs.

HTTP request

POST https://logging.googleapis.com/v2/entries:tail

The URL usesgRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{"resourceNames":[string],"filter":string,"bufferWindow":string}
Fields
resourceNames[]

string

Required. Name of a parent resource from which to retrieve log entries:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]

May alternatively be one or more views:

  • projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]

Authorization requires one or more of the followingIAM permissions on the specified resourceresourceNames:

  • logging.logEntries.list
  • logging.privateLogEntries.list
filter

string

Optional. A filter that chooses which log entries to return. For more information, seeLogging query language.

Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed inresourceNames. Referencing a parent resource that is not listed inresourceNames will cause the filter to return no results. The maximum length of a filter is 20,000 characters.

bufferWindow

string (Duration format)

Optional. The amount of time to buffer log entries at the server before being returned to prevent out of order results due to late arriving log entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 milliseconds.

A duration in seconds with up to nine fractional digits, ending with 's'. Example:"3.5s".

Response body

Result returned fromentries.tail.

If successful, the response body contains data with the following structure:

JSON representation
{"entries":[{object (LogEntry)}],"suppressionInfo":[{object (SuppressionInfo)}]}
Fields
entries[]

object (LogEntry)

A list of log entries. Each response in the stream will order entries with increasing values ofLogEntry.timestamp. Ordering is not guaranteed between separate responses.

suppressionInfo[]

object (SuppressionInfo)

If entries that otherwise would have been included in the session were not sent back to the client, counts of relevant entries omitted from the session with the reason that they were not included. There will be at most one of each reason per response. The counts represent the number of suppressed entries since the last streamed response.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see theAuthentication Overview.

SuppressionInfo

Information about entries that were omitted from the session.

JSON representation
{"reason":enum (Reason),"suppressedCount":integer}
Fields
reason

enum (Reason)

The reason that entries were omitted from the session.

suppressedCount

integer

A lower bound on the count of entries omitted due toreason.

Reason

An indicator of why entries were omitted.

Enums
REASON_UNSPECIFIEDUnexpected default.
RATE_LIMITIndicates suppression occurred due to relevant entries being received in excess of rate limits. For quotas and limits, seeLogging API quotas and limits.
NOT_CONSUMEDIndicates suppression occurred due to the client not consuming responses quickly enough.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-04 UTC.