Reference documentation and code samples for the Stackdriver Logging V2 Client class Settings.
Describes the settings associated with a project, folder, organization,
billing account, or flexible resource.
Generated from protobuf message google.logging.v2.Settings
Namespace
Google \ Cloud \ Logging \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. The resource name of the settings.
↳ kms_key_name
string
Optional. The resource name for the configured Cloud KMS key. KMS key name format: "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" For example: "projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key" To enable CMEK for the Log Router, set this field to a valid kms_key_name for which the associated service account has the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key. The Cloud KMS key used by the Log Router can be updated by changing the kms_key_name to a new valid key name. Encryption operations that are in progress will be completed with the key that was in use when they started. Decryption operations will be completed using the key that was used at the time of encryption unless access to that key has been revoked. To disable CMEK for the Log Router, set this field to an empty string. See Enabling CMEK for Log Router for more information.
↳ kms_service_account_id
string
Output only. The service account that will be used by the Log Router to access your Cloud KMS key. Before enabling CMEK for Log Router, you must first assign the role roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account that the Log Router will use to access your Cloud KMS key. Use GetSettings to obtain the service account ID. See Enabling CMEK for Log Router for more information.
↳ storage_location
string
Optional. The Cloud region that will be used for _Default and _Required log buckets for newly created projects and folders. For example europe-west1. This setting does not affect the location of custom log buckets.
↳ disable_default_sink
bool
Optional. If set to true, the _Default sink in newly created projects and folders will created in a disabled state. This can be used to automatically disable log ingestion if there is already an aggregated sink configured in the hierarchy. The _Default sink can be re-enabled manually if needed.
getName
Output only. The resource name of the settings.
Returns
Type
Description
string
setName
Output only. The resource name of the settings.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getKmsKeyName
Optional. The resource name for the configured Cloud KMS key.
KMS key name format:
"projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
For example:
"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"
To enable CMEK for the Log Router, set this field to a valid
kms_key_name for which the associated service account has the required
roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.
The Cloud KMS key used by the Log Router can be updated by changing the
kms_key_name to a new valid key name. Encryption operations that are in
progress will be completed with the key that was in use when they started.
Decryption operations will be completed using the key that was used at the
time of encryption unless access to that key has been revoked.
To disable CMEK for the Log Router, set this field to an empty string.
See Enabling CMEK for Log
Router
for more information.
Returns
Type
Description
string
setKmsKeyName
Optional. The resource name for the configured Cloud KMS key.
KMS key name format:
"projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
For example:
"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"
To enable CMEK for the Log Router, set this field to a valid
kms_key_name for which the associated service account has the required
roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.
The Cloud KMS key used by the Log Router can be updated by changing the
kms_key_name to a new valid key name. Encryption operations that are in
progress will be completed with the key that was in use when they started.
Decryption operations will be completed using the key that was used at the
time of encryption unless access to that key has been revoked.
To disable CMEK for the Log Router, set this field to an empty string.
See Enabling CMEK for Log
Router
for more information.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getKmsServiceAccountId
Output only. The service account that will be used by the Log Router to
access your Cloud KMS key.
Before enabling CMEK for Log Router, you must first assign the role
roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account that
the Log Router will use to access your Cloud KMS key. Use
GetSettings to
obtain the service account ID.
See Enabling CMEK for Log
Router
for more information.
Returns
Type
Description
string
setKmsServiceAccountId
Output only. The service account that will be used by the Log Router to
access your Cloud KMS key.
Before enabling CMEK for Log Router, you must first assign the role
roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account that
the Log Router will use to access your Cloud KMS key. Use
GetSettings to
obtain the service account ID.
See Enabling CMEK for Log
Router
for more information.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getStorageLocation
Optional. The Cloud region that will be used for _Default and _Required log
buckets for newly created projects and folders. For example europe-west1.
This setting does not affect the location of custom log buckets.
Returns
Type
Description
string
setStorageLocation
Optional. The Cloud region that will be used for _Default and _Required log
buckets for newly created projects and folders. For example europe-west1.
This setting does not affect the location of custom log buckets.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDisableDefaultSink
Optional. If set to true, the _Default sink in newly created projects and
folders will created in a disabled state. This can be used to automatically
disable log ingestion if there is already an aggregated sink configured in
the hierarchy. The _Default sink can be re-enabled manually if needed.
Returns
Type
Description
bool
setDisableDefaultSink
Optional. If set to true, the _Default sink in newly created projects and
folders will created in a disabled state. This can be used to automatically
disable log ingestion if there is already an aggregated sink configured in
the hierarchy. The _Default sink can be re-enabled manually if needed.
[[["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,["# Stackdriver Logging V2 Client - Class Settings (1.32.3)\n\nVersion latestkeyboard_arrow_down\n\n- [1.32.3 (latest)](/php/docs/reference/cloud-logging/latest/V2.Settings)\n- [1.32.2](/php/docs/reference/cloud-logging/1.32.2/V2.Settings)\n- [1.31.3](/php/docs/reference/cloud-logging/1.31.3/V2.Settings)\n- [1.30.3](/php/docs/reference/cloud-logging/1.30.3/V2.Settings)\n- [1.29.0](/php/docs/reference/cloud-logging/1.29.0/V2.Settings)\n- [1.28.5](/php/docs/reference/cloud-logging/1.28.5/V2.Settings)\n- [1.27.1](/php/docs/reference/cloud-logging/1.27.1/V2.Settings)\n- [1.26.0](/php/docs/reference/cloud-logging/1.26.0/V2.Settings)\n- [1.25.5](/php/docs/reference/cloud-logging/1.25.5/V2.Settings)\n- [1.24.10](/php/docs/reference/cloud-logging/1.24.10/V2.Settings) \nReference documentation and code samples for the Stackdriver Logging V2 Client class Settings.\n\nDescribes the settings associated with a project, folder, organization,\nbilling account, or flexible resource.\n\nGenerated from protobuf message `google.logging.v2.Settings`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Logging \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. The resource name of the settings.\n\n### setName\n\nOutput only. The resource name of the settings.\n\n### getKmsKeyName\n\nOptional. The resource name for the configured Cloud KMS key.\n\nKMS key name format:\n\"projects/\\[PROJECT_ID\\]/locations/\\[LOCATION\\]/keyRings/\\[KEYRING\\]/cryptoKeys/\\[KEY\\]\"\nFor example:\n`\"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key\"`\nTo enable CMEK for the Log Router, set this field to a valid\n`kms_key_name` for which the associated service account has the required\n`roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.\nThe Cloud KMS key used by the Log Router can be updated by changing the\n`kms_key_name` to a new valid key name. Encryption operations that are in\nprogress will be completed with the key that was in use when they started.\nDecryption operations will be completed using the key that was used at the\ntime of encryption unless access to that key has been revoked.\nTo disable CMEK for the Log Router, set this field to an empty string.\nSee [Enabling CMEK for Log\nRouter](https://cloud.google.com/logging/docs/routing/managed-encryption)\nfor more information.\n\n### setKmsKeyName\n\nOptional. The resource name for the configured Cloud KMS key.\n\nKMS key name format:\n\"projects/\\[PROJECT_ID\\]/locations/\\[LOCATION\\]/keyRings/\\[KEYRING\\]/cryptoKeys/\\[KEY\\]\"\nFor example:\n`\"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key\"`\nTo enable CMEK for the Log Router, set this field to a valid\n`kms_key_name` for which the associated service account has the required\n`roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.\nThe Cloud KMS key used by the Log Router can be updated by changing the\n`kms_key_name` to a new valid key name. Encryption operations that are in\nprogress will be completed with the key that was in use when they started.\nDecryption operations will be completed using the key that was used at the\ntime of encryption unless access to that key has been revoked.\nTo disable CMEK for the Log Router, set this field to an empty string.\nSee [Enabling CMEK for Log\nRouter](https://cloud.google.com/logging/docs/routing/managed-encryption)\nfor more information.\n\n### getKmsServiceAccountId\n\nOutput only. The service account that will be used by the Log Router to\naccess your Cloud KMS key.\n\nBefore enabling CMEK for Log Router, you must first assign the role\n`roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that\nthe Log Router will use to access your Cloud KMS key. Use\nGetSettings to\nobtain the service account ID.\nSee [Enabling CMEK for Log\nRouter](https://cloud.google.com/logging/docs/routing/managed-encryption)\nfor more information.\n\n### setKmsServiceAccountId\n\nOutput only. The service account that will be used by the Log Router to\naccess your Cloud KMS key.\n\nBefore enabling CMEK for Log Router, you must first assign the role\n`roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that\nthe Log Router will use to access your Cloud KMS key. Use\nGetSettings to\nobtain the service account ID.\nSee [Enabling CMEK for Log\nRouter](https://cloud.google.com/logging/docs/routing/managed-encryption)\nfor more information.\n\n### getStorageLocation\n\nOptional. The Cloud region that will be used for _Default and _Required log\nbuckets for newly created projects and folders. For example `europe-west1`.\n\nThis setting does not affect the location of custom log buckets.\n\n### setStorageLocation\n\nOptional. The Cloud region that will be used for _Default and _Required log\nbuckets for newly created projects and folders. For example `europe-west1`.\n\nThis setting does not affect the location of custom log buckets.\n\n### getDisableDefaultSink\n\nOptional. If set to true, the _Default sink in newly created projects and\nfolders will created in a disabled state. This can be used to automatically\ndisable log ingestion if there is already an aggregated sink configured in\nthe hierarchy. The _Default sink can be re-enabled manually if needed.\n\n### setDisableDefaultSink\n\nOptional. If set to true, the _Default sink in newly created projects and\nfolders will created in a disabled state. This can be used to automatically\ndisable log ingestion if there is already an aggregated sink configured in\nthe hierarchy. The _Default sink can be re-enabled manually if needed."]]