Stackdriver Logging V2 Client - Class LogExclusion (1.26.0)

Reference documentation and code samples for the Stackdriver Logging V2 Client class LogExclusion.

Specifies a set of log entries that are filtered out by a sink. If your Google Cloud resource receives a large volume of log entries, you can use exclusions to reduce your chargeable logs. Note that exclusions on organization-level and folder-level sinks don't apply to child resources.

Note also that you cannot modify the _Required sink or exclude logs from it.

Generated from protobuf message google.logging.v2.LogExclusion

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.

↳ description string

Optional. A description of this exclusion.

↳ filter string

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets: resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)

↳ disabled bool

Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.

↳ create_time Google\Protobuf\Timestamp

Output only. The creation timestamp of the exclusion. This field may not be present for older exclusions.

↳ update_time Google\Protobuf\Timestamp

Output only. The last update timestamp of the exclusion. This field may not be present for older exclusions.

getName

Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.

Returns
TypeDescription
string

setName

Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

Optional. A description of this exclusion.

Returns
TypeDescription
string

setDescription

Optional. A description of this exclusion.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getFilter

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries.

For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets: resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)

Returns
TypeDescription
string

setFilter

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries.

For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets: resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDisabled

Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.

Returns
TypeDescription
bool

setDisabled

Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getCreateTime

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getUpdateTime

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this