# Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::BackendServiceLogConfig (v3.7.0)

3.7.0 (latest) 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.22.0 2.21.1 2.20.0 2.19.1 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.2 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.10.0 1.9.0 1.8.0 1.7.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.5.0 Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::BackendServiceLogConfig.

The available logging options for the load balancer traffic served by this
backend service.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #enable

    def enable() -> ::Boolean

**Returns**

- (::Boolean) --- Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false.

### #enable=

    def enable=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false.
**Returns**

- (::Boolean) --- Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false.

### #optional_fields

    def optional_fields() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace

### #optional_fields=

    def optional_fields=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace
**Returns**

- (::Array\<::String\>) --- This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace

### #optional_mode

    def optional_mode() -> ::String

**Returns**

- (::String) --- This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of \[INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM\]. Default is EXCLUDE_ALL_OPTIONAL. Check the OptionalMode enum for the list of possible values.

### #optional_mode=

    def optional_mode=(value) -> ::String

**Parameter**

- **value** (::String) --- This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of \[INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM\]. Default is EXCLUDE_ALL_OPTIONAL. Check the OptionalMode enum for the list of possible values.
**Returns**

- (::String) --- This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of \[INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM\]. Default is EXCLUDE_ALL_OPTIONAL. Check the OptionalMode enum for the list of possible values.

### #sample_rate

    def sample_rate() -> ::Float

**Returns**

- (::Float) --- This field can only be specified if logging is enabled for this backend service. The value of the field must be in \[0, 1\]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.

### #sample_rate=

    def sample_rate=(value) -> ::Float

**Parameter**

- **value** (::Float) --- This field can only be specified if logging is enabled for this backend service. The value of the field must be in \[0, 1\]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.
**Returns**

- (::Float) --- This field can only be specified if logging is enabled for this backend service. The value of the field must be in \[0, 1\]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.