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 thestdoutorstderrstreams.
Generated from protobuf messagegoogle.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
Whendestinationis set toPATH, 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 withmountPathset to/mnt/disks/my-bucket, you can write logs to the root directory of theremotePathof that bucket by setting this field to/mnt/disks/my-bucket/.
Optional. Whendestinationis set toCLOUD_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
setDestination
If and where logs should be saved.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getLogsPath
Whendestinationis set toPATH, 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 withmountPathset to/mnt/disks/my-bucket, you can write logs to the
root directory of theremotePathof that bucket by setting this field to/mnt/disks/my-bucket/.
Returns
Type
Description
string
setLogsPath
Whendestinationis set toPATH, 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 withmountPathset to/mnt/disks/my-bucket, you can write logs to the
root directory of theremotePathof that bucket by setting this field to/mnt/disks/my-bucket/.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getCloudLoggingOption
Optional. Whendestinationis set toCLOUD_LOGGING, you can optionally
set this field to configure additional settings for Cloud Logging.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Batch V1 Client - Class LogsPolicy (1.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.2 (latest)](/php/docs/reference/cloud-batch/latest/V1.LogsPolicy)\n- [1.2.1](/php/docs/reference/cloud-batch/1.2.1/V1.LogsPolicy)\n- [1.1.7](/php/docs/reference/cloud-batch/1.1.7/V1.LogsPolicy)\n- [1.0.3](/php/docs/reference/cloud-batch/1.0.3/V1.LogsPolicy)\n- [0.17.0](/php/docs/reference/cloud-batch/0.17.0/V1.LogsPolicy)\n- [0.16.10](/php/docs/reference/cloud-batch/0.16.10/V1.LogsPolicy)\n- [0.15.0](/php/docs/reference/cloud-batch/0.15.0/V1.LogsPolicy)\n- [0.14.0](/php/docs/reference/cloud-batch/0.14.0/V1.LogsPolicy)\n- [0.13.1](/php/docs/reference/cloud-batch/0.13.1/V1.LogsPolicy)\n- [0.12.1](/php/docs/reference/cloud-batch/0.12.1/V1.LogsPolicy)\n- [0.11.3](/php/docs/reference/cloud-batch/0.11.3/V1.LogsPolicy)\n- [0.10.0](/php/docs/reference/cloud-batch/0.10.0/V1.LogsPolicy)\n- [0.9.0](/php/docs/reference/cloud-batch/0.9.0/V1.LogsPolicy)\n- [0.8.0](/php/docs/reference/cloud-batch/0.8.0/V1.LogsPolicy)\n- [0.7.0](/php/docs/reference/cloud-batch/0.7.0/V1.LogsPolicy)\n- [0.6.0](/php/docs/reference/cloud-batch/0.6.0/V1.LogsPolicy)\n- [0.5.2](/php/docs/reference/cloud-batch/0.5.2/V1.LogsPolicy)\n- [0.4.0](/php/docs/reference/cloud-batch/0.4.0/V1.LogsPolicy)\n- [0.3.0](/php/docs/reference/cloud-batch/0.3.0/V1.LogsPolicy)\n- [0.2.2](/php/docs/reference/cloud-batch/0.2.2/V1.LogsPolicy) \nReference documentation and code samples for the Google Cloud Batch V1 Client class LogsPolicy.\n\nLogsPolicy describes if and how a job's logs are preserved. Logs include\ninformation that is automatically written by the Batch service agent and any\ninformation that you configured the job's runnables to write to the `stdout`\nor `stderr` streams.\n\nGenerated from protobuf message `google.cloud.batch.v1.LogsPolicy`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Batch \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getDestination\n\nIf and where logs should be saved.\n\n### setDestination\n\nIf and where logs should be saved.\n\n### getLogsPath\n\nWhen `destination` is set to `PATH`, you must set this field to the path\nwhere you want logs to be saved. This path can point to a local directory\non the VM or (if congifured) a directory under the mount path of any\nCloud Storage bucket, network file system (NFS), or writable persistent\ndisk that is mounted to the job. For example, if the job has a bucket with\n`mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the\nroot directory of the `remotePath` of that bucket by setting this field to\n`/mnt/disks/my-bucket/`.\n\n### setLogsPath\n\nWhen `destination` is set to `PATH`, you must set this field to the path\nwhere you want logs to be saved. This path can point to a local directory\non the VM or (if congifured) a directory under the mount path of any\nCloud Storage bucket, network file system (NFS), or writable persistent\ndisk that is mounted to the job. For example, if the job has a bucket with\n`mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the\nroot directory of the `remotePath` of that bucket by setting this field to\n`/mnt/disks/my-bucket/`.\n\n### getCloudLoggingOption\n\nOptional. When `destination` is set to `CLOUD_LOGGING`, you can optionally\nset this field to configure additional settings for Cloud Logging.\n\n### hasCloudLoggingOption\n\n### clearCloudLoggingOption\n\n### setCloudLoggingOption\n\nOptional. When `destination` is set to `CLOUD_LOGGING`, you can optionally\nset this field to configure additional settings for Cloud Logging."]]