blob: 55f5447b0b7c1bfa5b66befa893dcd21546f8e16 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="logging_v1beta3.html">Google Cloud Logging API</a> . <a href="logging_v1beta3.projects.html">projects</a> . <a href="logging_v1beta3.projects.logs.html">logs</a> . <a href="logging_v1beta3.projects.logs.entries.html">entries</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#write">write(projectsId, logsId, body, x__xgafv=None)</a></code></p>
<p class="firstline">Writes log entries to Cloud Logging. Each entry consists of a `LogEntry` object. You must fill in all the fields of the object, including one of the payload fields. You may supply a map, `commonLabels`, that holds default (key, value) data for the `entries[].metadata.labels` map in each entry, saving you the trouble of creating identical copies for each entry.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="write">write(projectsId, logsId, body, x__xgafv=None)</code>
<pre>Writes log entries to Cloud Logging. Each entry consists of a `LogEntry` object. You must fill in all the fields of the object, including one of the payload fields. You may supply a map, `commonLabels`, that holds default (key, value) data for the `entries[].metadata.labels` map in each entry, saving you the trouble of creating identical copies for each entry.
Args:
projectsId: string, Part of `logName`. The resource name of the log that will receive the log entries. (required)
logsId: string, Part of `logName`. See documentation of `projectsId`. (required)
body: object, The request body. (required)
The object takes the form of:
{ # The parameters to WriteLogEntries.
"commonLabels": { # Metadata labels that apply to all log entries in this request, so that you don't have to repeat them in each log entry's `metadata.labels` field. If any of the log entries contains a (key, value) with the same key that is in `commonLabels`, then the entry's (key, value) overrides the one in `commonLabels`.
"a_key": "A String",
},
"entries": [ # Log entries to insert.
{ # An individual entry in a log.
"httpRequest": { # A common proto for logging HTTP requests. # Information about the HTTP request associated with this log entry, if applicable.
"status": 42, # A response code indicates the status of response, e.g., 200.
"requestUrl": "A String", # Contains the scheme (http|https), the host name, the path and the query portion of the URL that was requested.
"requestMethod": "A String", # Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
"referer": "A String", # Referer (a.k.a. referrer) URL of request, as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
"remoteIp": "A String", # IP address of the client who issues the HTTP request. Could be either IPv4 or IPv6.
"userAgent": "A String", # User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".
"requestSize": "A String", # Size of the HTTP request message in bytes, including request headers and the request body.
"responseSize": "A String", # Size of the HTTP response message in bytes sent back to the client, including response headers and response body.
},
"log": "A String", # The log to which this entry belongs. When a log entry is ingested, the value of this field is set by the logging system.
"textPayload": "A String", # The log entry payload, represented as a text string.
"structPayload": { # The log entry payload, represented as a structure that is expressed as a JSON object.
"a_key": "", # Properties of the object.
},
"insertId": "A String", # A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same log with the same ID as duplicates which can be removed.
"protoPayload": { # The log entry payload, represented as a protocol buffer that is expressed as a JSON object. You can only pass `protoPayload` values that belong to a set of approved types.
"a_key": "", # Properties of the object. Contains field @ype with type URL.
},
"metadata": { # Additional data that is associated with a log entry, set by the service creating the log entry. # Information about the log entry.
"severity": "A String", # The severity of the log entry.
"zone": "A String", # The zone of the Google Cloud Platform service that created the log entry. For example, `"us-central1-a"`.
"timestamp": "A String", # The time the event described by the log entry occurred. Timestamps must be later than January 1, 1970.
"region": "A String", # The region name of the Google Cloud Platform service that created the log entry. For example, `"us-central1"`.
"labels": { # A set of (key, value) data that provides additional information about the log entry. If the log entry is from one of the Google Cloud Platform sources listed below, the indicated (key, value) information must be provided: Google App Engine, service_name `appengine.googleapis.com`: "appengine.googleapis.com/module_id", "appengine.googleapis.com/version_id", and one of: "appengine.googleapis.com/replica_index", "appengine.googleapis.com/clone_id", or else provide the following Compute Engine labels: Google Compute Engine, service_name `compute.googleapis.com`: "compute.googleapis.com/resource_type", "instance" "compute.googleapis.com/resource_id",
"a_key": "A String",
},
"userId": "A String", # The fully-qualified email address of the authenticated user that performed or requested the action represented by the log entry. If the log entry does not apply to an action taken by an authenticated user, then the field should be empty.
"serviceName": "A String", # The API name of the Google Cloud Platform service that created the log entry. For example, `"compute.googleapis.com"`.
"projectId": "A String", # The project ID of the Google Cloud Platform service that created the log entry.
},
},
],
}
x__xgafv: string, V1 error format.
Returns:
An object of the form:
{ # Result returned from WriteLogEntries. empty
}</pre>
</div>
</body></html>