You can enable logging for Application Load Balancer callouts while creating the
service by enabling logging on the backend service that's thetargetof
a request (and not on the backend service associated with the extension).
RATE: a value from0.0through1.0,
where0.0means no requests are logged and1.0means 100% of
requests are logged. The default value is1.0. This setting is effective
only when used with theenable-loggingparameter. When you omitenable-logging, logging is disabled.
REGION: the region of the backend
LOGGING_OPTIONAL_MODE: enables logging for
optional fields in one of these modes:
INCLUDE_ALL_OPTIONALincludes all optional fields.
EXCLUDE_ALL_OPTIONAL(default) excludes all optional fields.
CUSTOMincludes a custom list of optional fields.
OPTIONAL_FIELDS: a comma-separated list of
optional fields when you select theCUSTOMmode
After you enable logging on the backend service, HTTP or HTTPS requests are
logged by usingCloud Logginglogs requests.
To view logs, in the Google Cloud console, go to the
theLogs Explorerpage.
Log messages for a backend service
In general, Application Load Balancer log entries contain information that is useful for
monitoring and debugging your HTTP or HTTPS traffic. Log entries contain the following
types of information:
Information shown in most Google Cloud logs, such as severity,
project ID, project number, and timestamp as described in theLogEntrylog.
Request logs for HTTP and HTTPS load balancers contain aservice_extension_infoobject in the load balancer log entry JSON payload with the following
information:
Field
Type
Description
backend_target_name
string
Name of the backend target of the extension
backend_target_type
string
Type of the backend target
chain
string
Name of the extension chain within the service extension resource that
matches the request
extension
string
Name of the extension within the extension chain
per_processing_request_info
array
Information about eachProcessingRequestmessage that's
sent to theext_procserver
per_processing_request_info[].event_type
enum
The event type ofProcessingRequest. Can be one of these:REQUEST_HEADERS,REQUEST_BODY,RESPONSE_HEADERS, orRESPONSE_BODY.
per_processing_request_info[].grpc_status
enum
The most recent status on the gRPC stream. For more information,
seegRPC status codes.
per_processing_request_info[].latency
duration
The duration from when the first byte of theProcessingRequestmessage is sent to the extension to when the last byte of theProcessingResponsemessage is received.
[[["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,["This page describes logging for Application Load Balancer callouts.\n\nFor a product overview, see [Service Extensions overview](/service-extensions/docs/overview).\n\nEnable logging on a backend service\n\nYou can enable logging for Application Load Balancer callouts while creating the\nservice by enabling logging on the backend service that's the *target* of\na request (and not on the backend service associated with the extension).\n| **Note:** Logging settings, if any, on the callout backend service, which is the backend service pointing to the callout, are ignored.\n\n\nTo enable logging for the target backend service for a regional internal Application Load Balancer, use the\n[`gcloud compute backend-services update` command](/sdk/gcloud/reference/compute/backend-services/update). \n\n```\ngcloud compute backend-services update BACKEND_SERVICE \\\n --enable-logging \\\n --logging-sample-rate=RATE \\\n --region=REGION \\\n --logging-optional=LOGGING_OPTIONAL_MODE \\\n --logging-optional-fields=OPTIONAL_FIELDS\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eBACKEND_SERVICE\u003c/var\u003e: the name of the backend service\n- \u003cvar translate=\"no\"\u003eRATE\u003c/var\u003e: a value from `0.0` through `1.0`, where `0.0` means no requests are logged and `1.0` means 100% of requests are logged. The default value is `1.0`. This setting is effective only when used with the `enable-logging` parameter. When you omit `enable-logging`, logging is disabled.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region of the backend\n- \u003cvar translate=\"no\"\u003eLOGGING_OPTIONAL_MODE\u003c/var\u003e: enables logging for\n optional fields in one of these modes:\n\n - `INCLUDE_ALL_OPTIONAL` includes all optional fields.\n - `EXCLUDE_ALL_OPTIONAL` (default) excludes all optional fields.\n - `CUSTOM` includes a custom list of optional fields.\n- \u003cvar translate=\"no\"\u003eOPTIONAL_FIELDS\u003c/var\u003e: a comma-separated list of optional fields when you select the `CUSTOM` mode\n\nFor more information, see the \"Monitor and troubleshoot\" pages of the\nApplication Load Balancer documentation, such as\n[Internal Application Load Balancer logging and monitoring](/load-balancing/docs/l7-internal/monitoring).\n\nAfter you enable logging on the backend service, HTTP or HTTPS requests are\nlogged by using [Cloud Logging](/logging/docs) logs requests.\n\nTo view logs, in the Google Cloud console, go to the\nthe [Logs Explorer](https://console.cloud.google.com/logs) page.\n\n\u003cbr /\u003e\n\nLog messages for a backend service\n\n\nIn general, Application Load Balancer log entries contain information that is useful for\nmonitoring and debugging your HTTP or HTTPS traffic. Log entries contain the following\ntypes of information:\n\n- Information shown in most Google Cloud logs, such as severity, project ID, project number, and timestamp as described in the [LogEntry](/logging/docs/reference/v2/rest/v2/LogEntry) log.\n- [HttpRequest](/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) log fields.\n\nRequest logs for HTTP and HTTPS load balancers contain a `service_extension_info`\nobject in the load balancer log entry JSON payload with the following\ninformation:\n\n| Field | Type | Description |\n|---------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `backend_target_name` | string | Name of the backend target of the extension |\n| `backend_target_type` | string | Type of the backend target |\n| `chain` | string | Name of the extension chain within the service extension resource that matches the request |\n| `extension` | string | Name of the extension within the extension chain |\n| `per_processing_request_info` | array | Information about each `ProcessingRequest` message that's sent to the `ext_proc` server |\n| `per_processing_request_info[].event_type` | enum | The event type of `ProcessingRequest`. Can be one of these: `REQUEST_HEADERS`, `REQUEST_BODY`, `RESPONSE_HEADERS`, or `RESPONSE_BODY`. |\n| `per_processing_request_info[].grpc_status` | enum | The most recent status on the gRPC stream. For more information, see [gRPC status codes](https://grpc.io/docs/guides/status-codes/). |\n| `per_processing_request_info[].latency` | duration | The duration from when the first byte of the `ProcessingRequest` message is sent to the extension to when the last byte of the `ProcessingResponse` message is received. |\n| `resource` | string | Name of the extension resource |\n\n\u003cbr /\u003e\n\nWhat's next\n\n- [Monitor callout backend services](/service-extensions/docs/monitor-callouts)"]]