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 uses gRPC 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 following IAM permissions on the specified resource resourceNames:

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

string

Optional. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resourceNames. Referencing a parent resource that is not listed in resourceNames 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 from entries.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 of LogEntry.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 the Authentication 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 to reason.

Reason

An indicator of why entries were omitted.

Enums
REASON_UNSPECIFIED Unexpected default.
RATE_LIMIT Indicates suppression occurred due to relevant entries being received in excess of rate limits. For quotas and limits, see Logging API quotas and limits.
NOT_CONSUMED Indicates suppression occurred due to the client not consuming responses quickly enough.