Cloud Logging Service, gRPC: LogIngestionService.Write
Write log entries to specified destination.
gRPC request
rpc Write (WriteRequest) returns (WriteResponse)
WriteRequest
{
"destination": {
// Includes only one of the fields `log_group_id`, `folder_id`
"log_group_id": "string",
"folder_id": "string"
// end of the list of possible fields
},
"resource": {
"type": "string",
"id": "string"
},
"entries": [
{
"timestamp": "google.protobuf.Timestamp",
"level": "Level",
"message": "string",
"json_payload": "google.protobuf.Struct",
"stream_name": "string"
}
],
"defaults": {
"level": "Level",
"json_payload": "google.protobuf.Struct",
"stream_name": "string"
}
}
|
Field |
Description |
|
destination |
Required field. Log entries destination. |
|
resource |
Required field. Common resource (type, ID) specification for log entries. |
|
entries[] |
List of log entries. The number of elements must be in the range 1-100. |
|
defaults |
Log entries defaults. |
Destination
|
Field |
Description |
|
log_group_id |
string Entry should be written to log group resolved by ID. The maximum string length in characters is 63. Value must match the regular expression Includes only one of the fields Entry destination. |
|
folder_id |
string Entry should be written to default log group for the folder. Value must match the regular expression Includes only one of the fields Entry destination. |
LogEntryResource
Log entry resource specification.
May be used either by services and by user.
|
Field |
Description |
|
type |
string Resource type, i.e., 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. |
IncomingLogEntry
|
Field |
Description |
|
timestamp |
Required field. Timestamp of the entry. |
|
level |
enum Level Entry severity.
|
|
message |
string Entry text message. |
|
json_payload |
Entry annotation. |
|
stream_name |
string Entry stream name. The maximum string length in characters is 71. |
LogEntryDefaults
|
Field |
Description |
|
level |
enum Level Default entry severity.
|
|
json_payload |
Default entry annotation. |
|
stream_name |
string Entry stream name. The maximum string length in characters is 71. |
WriteResponse
{
"errors": "map<int64, google.rpc.Status>"
}
|
Field |
Description |
|
errors |
object (map<int64, google.rpc.Status The error result of the operation in case of failure or cancellation. |