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. See Destination for details. |
|
resource |
Common resource (type, ID) specification for log entries. |
|
entries[] |
List of log entries. |
|
defaults |
Log entries defaults. See LogEntryDefaults for details. |
Destination
|
Field |
Description |
|
log_group_id |
string Entry should be written to log group resolved by ID. Includes only one of the fields Entry destination. |
|
folder_id |
string Entry should be written to default log group for the folder. 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., |
|
id |
string Resource ID, i.e., ID of the function producing logs. |
IncomingLogEntry
|
Field |
Description |
|
timestamp |
Required field. Timestamp of the entry. |
|
level |
enum Level Entry severity. See LogLevel.Level for details.
|
|
message |
string Entry text message. |
|
json_payload |
Entry annotation. |
|
stream_name |
string Entry stream name. |
LogEntryDefaults
|
Field |
Description |
|
level |
enum Level Default entry severity. See LogLevel.Level for details.
|
|
json_payload |
Default entry annotation. |
|
stream_name |
string Entry stream name. |
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. |