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 `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string"
// end of the list of possible fields
},
"resource": {
"type": "string",
"id": "string"
},
"entries": [
{
"timestamp": "google.protobuf.Timestamp",
"level": "Level",
"message": "string",
"jsonPayload": "google.protobuf.Struct",
"streamName": "string"
}
],
"defaults": {
"level": "Level",
"jsonPayload": "google.protobuf.Struct",
"streamName": "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 |
logGroupId |
string Entry should be written to log group resolved by ID. Includes only one of the fields Entry destination. |
folderId |
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. |
jsonPayload |
Entry annotation. |
streamName |
string Entry stream name. |
LogEntryDefaults
Field |
Description |
level |
enum Level Default entry severity. See LogLevel.Level for details.
|
jsonPayload |
Default entry annotation. |
streamName |
string Entry stream name. |
WriteResponse
{
"errors": "google.rpc.Status"
}
Field |
Description |
errors |
The error result of the operation in case of failure or cancellation. |