# Stackdriver Logging V2 Client - Class LogExclusion (2.1.0)

2.1.0 (latest) 2.0.0 1.34.5 1.33.0 1.32.3 1.31.3 1.30.3 1.29.0 1.28.5 1.27.1 1.26.0 1.25.5 1.24.10 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`

## Namespace

Google \\ Cloud \\ Logging \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `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](https://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the [sample function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), 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](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.Client.ConfigServiceV2Client#_Google_Cloud_Logging_V2_Client_ConfigServiceV2Client__updateExclusion__) to change the value of this field. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The creation timestamp of the exclusion. This field may not be present for older exclusions. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDescription

Optional. A description of this exclusion.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDescription

Optional. A description of this exclusion.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFilter

Required. An [advanced logs
filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
matches the log entries to be excluded. By using the [sample
function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
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** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFilter

Required. An [advanced logs
filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
matches the log entries to be excluded. By using the [sample
function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
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** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.Client.ConfigServiceV2Client#_Google_Cloud_Logging_V2_Client_ConfigServiceV2Client__updateExclusion__) to change the
value of this field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.Client.ConfigServiceV2Client#_Google_Cloud_Logging_V2_Client_ConfigServiceV2Client__updateExclusion__) to change the
value of this field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/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** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/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** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |