- JSON representation
- LogSeverity
- HttpRequest
- MonitoredResourceMetadata
- LogEntryOperation
- LogEntrySourceLocation
- LogSplit
- LogErrorGroup
An individual entry in a log.
JSON representation |
---|
{ "logName": string, "resource": { object ( |
Fields | |
---|---|
log |
Required. The resource name of the log to which this log entry belongs:
A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the
For backward compatibility, if |
resource |
Required. The monitored resource that produced this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. |
timestamp |
Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed. Incoming log entries must have timestamps that don't exceed the logs retention period in the past, and that don't exceed 24 hours in the future. Log entries outside those time boundaries are rejected by Logging. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
receive |
Output only. The time the log entry was received by Logging. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
severity |
Optional. The severity of the log entry. The default value is |
insert |
Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same If the In queries, the |
http |
Optional. Information about the HTTP request associated with this log entry, if applicable. |
labels |
Optional. A map of key, value pairs that provides additional information about the log entry. The labels can be user-defined or system-defined. User-defined labels are arbitrary key, value pairs that you can use to classify logs. System-defined labels are defined by GCP services for platform logs. They have two components - a service namespace component and the attribute name. For example: Cloud Logging truncates label keys that exceed 512 B and label values that exceed 64 KB upon their associated log entry being written. The truncation is indicated by an ellipsis at the end of the character string. |
metadata |
Output only. Deprecated. This field is not used by Logging. Any value written to it is cleared. |
operation |
Optional. Information about an operation associated with the log entry, if applicable. |
trace |
Optional. The REST resource name of the trace being written to Cloud Trace in association with this log entry. For example, if your trace data is stored in the Cloud project "my-trace-project" and if the service that is creating the log entry receives a trace header that includes the trace ID "12345", then the service should use "projects/my-trace-project/traces/12345". The |
span |
Optional. The ID of the Cloud Trace span associated with the current operation in which the log is being written. For example, if a span has the REST resource name of "projects/some-project/traces/some-trace/spans/some-span-id", then the A Span represents a single operation within a trace. Whereas a trace may involve multiple different microservices running on multiple different machines, a span generally corresponds to a single logical operation being performed in a single instance of a microservice on one specific machine. Spans are the nodes within the tree that is a trace. Applications that are instrumented for tracing will generally assign a new, unique span ID on each incoming request. It is also common to create and record additional spans corresponding to internal processing elements as well as issuing requests to dependencies. The span ID is expected to be a 16-character, hexadecimal encoding of an 8-byte array and should not be zero. It should be unique within the trace and should, ideally, be generated in a manner that is uniformly random. Example values:
|
trace |
Optional. The sampling decision of the span associated with the log entry at the time the log entry was created. This field corresponds to the sampled flag in the W3C trace-context specification. A non-sampled |
source |
Optional. Source code location information associated with the log entry, if any. |
split |
Optional. Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry. |
error |
Output only. The Error Reporting error groups associated with this LogEntry. Error Reporting sets the values for this field during error group creation. For more information, see [View error details]( https://cloud.google.com/error-reporting/docs/viewing-errors#view_error_details) This field isn't available during log routing |
Union field payload . The log entry payload, which can be one of multiple types. payload can be only one of the following: |
|
proto |
The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. The following protocol buffer types are supported; user-defined types are not supported: "type.googleapis.com/google.cloud.audit.AuditLog" "type.googleapis.com/google.appengine.logging.v1.RequestLog" An object containing fields of an arbitrary type. An additional field |
text |
The log entry payload, represented as a Unicode string (UTF-8). |
json |
The log entry payload, represented as a structure that is expressed as a JSON object. |
LogSeverity
The severity of the event described in a log entry, expressed as one of the standard severity levels listed below. For your reference, the levels are assigned the listed numeric values. The effect of using numeric values other than those listed is undefined.
You can filter for log entries by severity. For example, the following filter expression will match log entries with severities INFO
, NOTICE
, and WARNING
:
severity > DEBUG AND severity <= WARNING
If you are writing log entries, you should map other severity encodings to one of these standard levels. For example, you might map all of Java's FINE, FINER, and FINEST levels to LogSeverity.DEBUG
. You can preserve the original severity level in the log entry payload if you wish.
Enums | |
---|---|
DEFAULT |
(0) The log entry has no assigned severity level. |
DEBUG |
(100) Debug or trace information. |
INFO |
(200) Routine information, such as ongoing status or performance. |
NOTICE |
(300) Normal but significant events, such as start up, shut down, or a configuration change. |
WARNING |
(400) Warning events might cause problems. |
ERROR |
(500) Error events are likely to cause problems. |
CRITICAL |
(600) Critical events cause more severe problems or outages. |
ALERT |
(700) A person must take an action immediately. |
EMERGENCY |
(800) One or more systems are unusable. |
HttpRequest
A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.
JSON representation |
---|
{ "requestMethod": string, "requestUrl": string, "requestSize": string, "status": integer, "responseSize": string, "userAgent": string, "remoteIp": string, "serverIp": string, "referer": string, "latency": string, "cacheLookup": boolean, "cacheHit": boolean, "cacheValidatedWithOriginServer": boolean, "cacheFillBytes": string, "protocol": string } |
Fields | |
---|---|
request |
The request method. Examples: |
request |
The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: |
request |
The size of the HTTP request message in bytes, including the request headers and the request body. |
status |
The response code indicating the status of response. Examples: 200, 404. |
response |
The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. |
user |
The user agent sent by the client. Example: |
remote |
The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: |
server |
The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: |
referer |
The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. |
latency |
The request processing latency on the server, from the time the request was received until the response was sent. For WebSocket connections, this field refers to the entire time duration of the connection. A duration in seconds with up to nine fractional digits, ending with ' |
cache |
Whether or not a cache lookup was attempted. |
cache |
Whether or not an entity was served from cache (with or without validation). |
cache |
Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if |
cache |
The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. |
protocol |
Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2" |
MonitoredResourceMetadata
Auxiliary metadata for a MonitoredResource
object. MonitoredResource
objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message.
JSON representation |
---|
{ "systemLabels": { object }, "userLabels": { string: string, ... } } |
Fields | |
---|---|
system |
Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including "machine_image", "vpc", "subnet_id", "security_group", "name", etc. System label values can be only strings, Boolean values, or a list of strings. For example:
|
user |
Output only. A map of user-defined metadata labels. |
LogEntryOperation
Additional information about a potentially long-running operation with which a log entry is associated.
JSON representation |
---|
{ "id": string, "producer": string, "first": boolean, "last": boolean } |
Fields | |
---|---|
id |
Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. |
producer |
Optional. An arbitrary producer identifier. The combination of |
first |
Optional. Set this to True if this is the first log entry in the operation. |
last |
Optional. Set this to True if this is the last log entry in the operation. |
LogEntrySourceLocation
Additional information about the source code location that produced the log entry.
JSON representation |
---|
{ "file": string, "line": string, "function": string } |
Fields | |
---|---|
file |
Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name. |
line |
Optional. Line within the source file. 1-based; 0 indicates no line number available. |
function |
Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: |
LogSplit
Additional information used to correlate multiple log entries. Used when a single LogEntry would exceed the Google Cloud Logging size limit and is split across multiple log entries.
JSON representation |
---|
{ "uid": string, "index": integer, "totalSplits": integer } |
Fields | |
---|---|
uid |
A globally unique identifier for all log entries in a sequence of split log entries. All log entries with the same |LogSplit.uid| are assumed to be part of the same sequence of split log entries. |
index |
The index of this LogEntry in the sequence of split log entries. Log entries are given |index| values 0, 1, ..., n-1 for a sequence of n log entries. |
total |
The total number of log entries that the original LogEntry was split into. |
LogErrorGroup
Contains metadata that associates the LogEntry to Error Reporting error groups.
JSON representation |
---|
{ "id": string } |
Fields | |
---|---|
id |
The id is a unique identifier for a particular error group; it is the last part of the error group resource name: |