Cloud Logging Service, gRPC: LogReadingService
Written by
Updated at August 30, 2023
A set of methods for reading from log groups.
Call | Description |
---|---|
Read | Read log entries from the specified log group. |
Calls LogReadingService
Read
Read log entries from the specified log group.
rpc Read (ReadRequest) returns (ReadResponse)
ReadRequest
Field | Description |
---|---|
selector | oneof: page_token or criteria Read selector. |
page_token | string Page token. To get the next page of results, set page_token to the ReadResponse.next_page_token or ReadResponse.previous_page_token returned by a previous read request. |
criteria | Criteria Read criteria. See Criteria for details. |
Criteria
Field | Description |
---|---|
log_group_id | string Required. ID of the log group to return. To get a log group ID make a LogGroupService.List request. The maximum string length in characters is 64. |
resource_types[] | string List of resource types to limit log entries to. Empty list disables filter. The maximum string length in characters for each value is 63. The maximum number of elements is 100. |
resource_ids[] | string List of resource IDs to limit log entries to. Empty list disables filter. The maximum string length in characters for each value is 63. The maximum number of elements is 100. |
since | google.protobuf.Timestamp Lower bound of log entries timestamps. |
until | google.protobuf.Timestamp Upper bound of log entries timestamps. |
levels[] | LogLevel.Level List of log levels to limit log entries to. Empty list disables filter. The maximum number of elements is 10. |
filter | string Filter expression. For details about filtering, see documentation. The maximum string length in characters is 1000. |
stream_names[] | string List of stream names to limit log entries to. Empty list disables filter. The maximum string length in characters for each value is 63. The maximum number of elements is 100. |
page_size | int64 The maximum number of results per page to return. Acceptable values are 0 to 1000, inclusive. |
max_response_size | int64 Limits response to maximum size in bytes. Prevents gRPC resource exhaustion. Default value for max response size is 3.5 MiB Acceptable values are 0 to 10485760, inclusive. |
ReadResponse
Field | Description |
---|---|
log_group_id | string Log group ID the read was performed from. |
entries[] | LogEntry List of matching log entries. |
next_page_token | string Token for getting the next page of the log entries. After getting log entries initially with Criteria, you can use next_page_token as the value for the ReadRequest.page_token parameter in the next read request. Each subsequent page will have its own next_page_token to continue paging through the results. |
previous_page_token | string Token for getting the previous page of the log entries. After getting log entries initially with Criteria, you can use previous_page_token as the value for the ReadRequest.page_token parameter in the next read request. Each subsequent page will have its own next_page_token to continue paging through the results. |
LogEntry
Field | Description |
---|---|
uid | string Unique entry ID. Useful for logs deduplication. |
resource | LogEntryResource Entry resource specification. May contain information about source service and resource ID. Also may be provided by the user. |
timestamp | google.protobuf.Timestamp Timestamp of the entry. |
ingested_at | google.protobuf.Timestamp Entry ingestion time observed by [LogIngestionService]. |
saved_at | google.protobuf.Timestamp Entry save time. Entry is ready to be read since this moment. |
level | LogLevel.Level Entry severity. See LogLevel.Level for details. |
message | string Entry text message. |
json_payload | google.protobuf.Struct Entry annotation. |
stream_name | string Entry stream name. The maximum string length in characters is 63. |
LogEntryResource
Field | Description |
---|---|
type | string Resource type, i.e., serverless.function The maximum string length in characters is 63. |
id | string Resource ID, i.e., ID of the function producing logs. The maximum string length in characters is 63. |