public sealed class BackendServiceLogConfig : IMessage<BackendServiceLogConfig>, IEquatable<BackendServiceLogConfig>, IDeepCloneable<BackendServiceLogConfig>, IBufferMessage, IMessage
Reference documentation and code samples for the Compute Engine v1 API class BackendServiceLogConfig.
The available logging options for the load balancer traffic served by this backend service.
public RepeatedField<string> OptionalFields { get; }
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
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003eBackendServiceLogConfig\u003c/code\u003e class within the Google Compute Engine v1 API for .NET.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBackendServiceLogConfig\u003c/code\u003e class offers logging options for load balancer traffic managed by a backend service, with properties to enable logging and configure sampling rates.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes methods for managing optional fields to be included in logs such as server instances or server GKE details, allowing customizable log outputs.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation lists the available versions of the \u003ccode\u003eBackendServiceLogConfig\u003c/code\u003e class, ranging from the latest (3.6.0) down to version 1.0.0, providing access to previous versions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBackendServiceLogConfig\u003c/code\u003e implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from the base object class.\u003c/p\u003e\n"]]],[],null,["# Compute Engine v1 API - Class BackendServiceLogConfig (3.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.12.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.11.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.10.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.9.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.8.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.7.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.6.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.5.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.4.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.3.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.2.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.1.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.0.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.17.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.17.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.16.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.16.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.15.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.14.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.13.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.12.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.11.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.10.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.9.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.8.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.7.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.6.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.5.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.4.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.3.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.2.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.1.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.0.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.4.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.3.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.2.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.1.0/Google.Cloud.Compute.V1.BackendServiceLogConfig)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.0.0/Google.Cloud.Compute.V1.BackendServiceLogConfig) \n\n public sealed class BackendServiceLogConfig : IMessage\u003cBackendServiceLogConfig\u003e, IEquatable\u003cBackendServiceLogConfig\u003e, IDeepCloneable\u003cBackendServiceLogConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Compute Engine v1 API class BackendServiceLogConfig.\n\nThe available logging options for the load balancer traffic served by this backend service. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BackendServiceLogConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BackendServiceLogConfig](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.BackendServiceLogConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BackendServiceLogConfig](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.BackendServiceLogConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BackendServiceLogConfig](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.BackendServiceLogConfig), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Compute.V1](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Compute.V1.dll\n\nConstructors\n------------\n\n### BackendServiceLogConfig()\n\n public BackendServiceLogConfig()\n\n### BackendServiceLogConfig(BackendServiceLogConfig)\n\n public BackendServiceLogConfig(BackendServiceLogConfig other)\n\nProperties\n----------\n\n### Enable\n\n public bool Enable { get; set; }\n\nDenotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false.\n\n### HasEnable\n\n public bool HasEnable { get; }\n\nGets whether the \"enable\" field is set\n\n### HasOptionalMode\n\n public bool HasOptionalMode { get; }\n\nGets whether the \"optional_mode\" field is set\n\n### HasSampleRate\n\n public bool HasSampleRate { get; }\n\nGets whether the \"sample_rate\" field is set\n\n### OptionalFields\n\n public RepeatedField\u003cstring\u003e OptionalFields { get; }\n\nThis 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\n\n### OptionalMode\n\n public string OptionalMode { get; set; }\n\nThis 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.\nCheck the OptionalMode enum for the list of possible values.\n\n### SampleRate\n\n public float SampleRate { get; set; }\n\nThis 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."]]