Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName
field.
HTTP request
POST https://logging.googleapis.com/v2/entries:write
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "logName": string, "resource": { object ( |
Fields | |
---|---|
log |
Optional. A default log resource name that is assigned to all log entries in
The permission Authorization requires the following IAM permission on the specified resource
|
resource |
Optional. A default monitored resource object that is assigned to all log entries in
See |
labels |
Optional. Default labels that are added to the |
entries[] |
Required. The log entries to send to Logging. The order of log entries in this list does not matter. Values supplied in this method's If the Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future will not be available when calling To improve throughput and to avoid exceeding the quota limit for calls to Authorization requires the following IAM permission on the specified resource
|
partial |
Optional. Whether a batch's valid entries should be written even if some other entry failed due to a permanent error such as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then the response status is the response status of one of the failed entries. The response will include error details in |
dry |
Optional. If true, the request should expect normal response, but the entries won't be persisted nor exported. Useful for checking whether the logging API endpoints are working properly before sending valuable data. |
Response body
If successful, the response body is empty.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/logging.write
https://www.googleapis.com/auth/logging.admin
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.