class LogEntry extends Message

An individual entry in a log.

Protobuf type Google\Logging\V2\LogEntry

Properties

protected $payload

Methods

__construct()

No description

string
getLogName()

Required. The resource name of the log to which this log entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity".

setLogName(string $var)

Required. The resource name of the log to which this log entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity".

getResource()

Required. The monitored resource associated with this log entry.

setResource(MonitoredResource $var)

Required. The monitored resource associated with this log entry.

Any
getProtoPayload()

The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.

setProtoPayload(Any $var)

The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.

string
getTextPayload()

The log entry payload, represented as a Unicode string (UTF-8).

setTextPayload(string $var)

The log entry payload, represented as a Unicode string (UTF-8).

getJsonPayload()

The log entry payload, represented as a structure that is expressed as a JSON object.

setJsonPayload(Struct $var)

The log entry payload, represented as a structure that is expressed as a JSON object.

getTimestamp()

Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.

setTimestamp(Timestamp $var)

Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.

getReceiveTimestamp()

Output only. The time the log entry was received by Stackdriver Logging.

setReceiveTimestamp(Timestamp $var)

Output only. The time the log entry was received by Stackdriver Logging.

int
getSeverity()

Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.

setSeverity(int $var)

Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.

string
getInsertId()

Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value.

setInsertId(string $var)

Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value.

getHttpRequest()

Optional. Information about the HTTP request associated with this log entry, if applicable.

setHttpRequest(HttpRequest $var)

Optional. Information about the HTTP request associated with this log entry, if applicable.

RepeatedField
getLabels()

Optional. A set of user-defined (key, value) data that provides additional information about the log entry.

setLabels(array|RepeatedField $var)

Optional. A set of user-defined (key, value) data that provides additional information about the log entry.

getOperation()

Optional. Information about an operation associated with the log entry, if applicable.

setOperation(LogEntryOperation $var)

Optional. Information about an operation associated with the log entry, if applicable.

string
getTrace()

Optional. Resource name of the trace associated with the log entry, if any.

setTrace(string $var)

Optional. Resource name of the trace associated with the log entry, if any.

getSourceLocation()

Optional. Source code location information associated with the log entry, if any.

setSourceLocation(LogEntrySourceLocation $var)

Optional. Source code location information associated with the log entry, if any.

string
getPayload()

No description

Details

at line 120
__construct()

at line 145
string getLogName()

Required. The resource name of the log to which this log entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity".

[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period. For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.

Generated from protobuf field string log_name = 12;

Return Value

string

at line 170
setLogName(string $var)

Required. The resource name of the log to which this log entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity".

[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period. For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.

Generated from protobuf field string log_name = 12;

Parameters

string $var

at line 185
MonitoredResource getResource()

Required. The monitored resource associated with 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.

Generated from protobuf field .google.api.MonitoredResource resource = 8;

Return Value

MonitoredResource

at line 199
setResource(MonitoredResource $var)

Required. The monitored resource associated with 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.

Generated from protobuf field .google.api.MonitoredResource resource = 8;

Parameters

MonitoredResource $var

at line 213
Any getProtoPayload()

The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.

Generated from protobuf field .google.protobuf.Any proto_payload = 2;

Return Value

Any

at line 226
setProtoPayload(Any $var)

The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.

Generated from protobuf field .google.protobuf.Any proto_payload = 2;

Parameters

Any $var

at line 238
string getTextPayload()

The log entry payload, represented as a Unicode string (UTF-8).

Generated from protobuf field string text_payload = 3;

Return Value

string

at line 249
setTextPayload(string $var)

The log entry payload, represented as a Unicode string (UTF-8).

Generated from protobuf field string text_payload = 3;

Parameters

string $var

at line 262
Struct getJsonPayload()

The log entry payload, represented as a structure that is expressed as a JSON object.

Generated from protobuf field .google.protobuf.Struct json_payload = 6;

Return Value

Struct

at line 274
setJsonPayload(Struct $var)

The log entry payload, represented as a structure that is expressed as a JSON object.

Generated from protobuf field .google.protobuf.Struct json_payload = 6;

Parameters

Struct $var

at line 290
Timestamp getTimestamp()

Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.

Generated from protobuf field .google.protobuf.Timestamp timestamp = 9;

Return Value

Timestamp

at line 305
setTimestamp(Timestamp $var)

Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.

Generated from protobuf field .google.protobuf.Timestamp timestamp = 9;

Parameters

Timestamp $var

at line 317
Timestamp getReceiveTimestamp()

Output only. The time the log entry was received by Stackdriver Logging.

Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24;

Return Value

Timestamp

at line 328
setReceiveTimestamp(Timestamp $var)

Output only. The time the log entry was received by Stackdriver Logging.

Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24;

Parameters

Timestamp $var

at line 341
int getSeverity()

Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.

Generated from protobuf field .google.logging.type.LogSeverity severity = 10;

Return Value

int

at line 353
setSeverity(int $var)

Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.

Generated from protobuf field .google.logging.type.LogSeverity severity = 10;

Parameters

int $var

at line 370
string getInsertId()

Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value.

Generated from protobuf field string insert_id = 4;

Return Value

string

at line 386
setInsertId(string $var)

Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value.

Generated from protobuf field string insert_id = 4;

Parameters

string $var

at line 399
HttpRequest getHttpRequest()

Optional. Information about the HTTP request associated with this log entry, if applicable.

Generated from protobuf field .google.logging.type.HttpRequest http_request = 7;

Return Value

HttpRequest

at line 411
setHttpRequest(HttpRequest $var)

Optional. Information about the HTTP request associated with this log entry, if applicable.

Generated from protobuf field .google.logging.type.HttpRequest http_request = 7;

Parameters

HttpRequest $var

at line 424
RepeatedField getLabels()

Optional. A set of user-defined (key, value) data that provides additional information about the log entry.

Generated from protobuf field map<string, string> labels = 11;

Return Value

RepeatedField

at line 436
setLabels(array|RepeatedField $var)

Optional. A set of user-defined (key, value) data that provides additional information about the log entry.

Generated from protobuf field map<string, string> labels = 11;

Parameters

array|RepeatedField $var

at line 449
LogEntryOperation getOperation()

Optional. Information about an operation associated with the log entry, if applicable.

Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15;

Return Value

LogEntryOperation

at line 461
setOperation(LogEntryOperation $var)

Optional. Information about an operation associated with the log entry, if applicable.

Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15;

Parameters

LogEntryOperation $var

at line 476
string getTrace()

Optional. Resource name of the trace associated with the log entry, if any.

If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824

Generated from protobuf field string trace = 22;

Return Value

string

at line 490
setTrace(string $var)

Optional. Resource name of the trace associated with the log entry, if any.

If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824

Generated from protobuf field string trace = 22;

Parameters

string $var

at line 503
LogEntrySourceLocation getSourceLocation()

Optional. Source code location information associated with the log entry, if any.

Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23;

Return Value

LogEntrySourceLocation

at line 515
setSourceLocation(LogEntrySourceLocation $var)

Optional. Source code location information associated with the log entry, if any.

Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23;

Parameters

LogEntrySourceLocation $var

at line 524
string getPayload()

Return Value

string