# Google Cloud Batch V1 Client - Class LogsPolicy (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.7 1.0.3 0.17.0 0.16.10 0.15.0 0.14.0 0.13.1 0.12.1 0.11.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.2 0.4.0 0.3.0 0.2.2 Reference documentation and code samples for the Google Cloud Batch V1 Client class LogsPolicy.

LogsPolicy describes if and how a job's logs are preserved. Logs include
information that is automatically written by the Batch service agent and any
information that you configured the job's runnables to write to the `stdout`
or `stderr` streams.

Generated from protobuf message `google.cloud.batch.v1.LogsPolicy`

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ destination` | `int` If and where logs should be saved. |
| `↳ logs_path` | `string` When `destination` is set to `PATH`, you must set this field to the path where you want logs to be saved. This path can point to a local directory on the VM or (if congifured) a directory under the mount path of any Cloud Storage bucket, network file system (NFS), or writable persistent disk that is mounted to the job. For example, if the job has a bucket with `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the root directory of the `remotePath` of that bucket by setting this field to `/mnt/disks/my-bucket/`. |
| `↳ cloud_logging_option` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy.CloudLoggingOption` Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally set this field to configure additional settings for Cloud Logging. |

### getDestination

If and where logs should be saved.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Destination](https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy.Destination). |

### setDestination

If and where logs should be saved.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Destination](https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy.Destination). |

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

### getLogsPath

When `destination` is set to `PATH`, you must set this field to the path
where you want logs to be saved. This path can point to a local directory
on the VM or (if congifured) a directory under the mount path of any
Cloud Storage bucket, network file system (NFS), or writable persistent
disk that is mounted to the job. For example, if the job has a bucket with
`mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the
root directory of the `remotePath` of that bucket by setting this field to
`/mnt/disks/my-bucket/`.

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

### setLogsPath

When `destination` is set to `PATH`, you must set this field to the path
where you want logs to be saved. This path can point to a local directory
on the VM or (if congifured) a directory under the mount path of any
Cloud Storage bucket, network file system (NFS), or writable persistent
disk that is mounted to the job. For example, if the job has a bucket with
`mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the
root directory of the `remotePath` of that bucket by setting this field to
`/mnt/disks/my-bucket/`.

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

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

### getCloudLoggingOption

Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally
set this field to configure additional settings for Cloud Logging.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy.CloudLoggingOption|null` |   |

### hasCloudLoggingOption

### clearCloudLoggingOption

### setCloudLoggingOption

Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally
set this field to configure additional settings for Cloud Logging.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy.CloudLoggingOption` |

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