Each Cloud CDN request is logged in Stackdriver Logging. Logging is automatic and does not need to be enabled.
To view Cloud CDN logs, go to the Logs Viewer in the Cloud Platform Console.
- To see all logs, in the first pull-down menu select Load Balancing > All forwarding rules.
- To see logs for just one forwarding rule, select a single forwarding rule name from the list.
- To see logs for just one URL map used by a forwarding rule, select Load Balancing and choose the forwarding rule and URL map of interest.
What is logged
In addition to general information contained in most logs, such as severity,
project ID, project number, and timestamp, HTTP(S) Load
contain both HttpRequest log
fields as well as the
fields of the
You can filter on these fields to determine the cache hit, miss or revalidation status of a request served by Cloud CDN:
Cache Hit Validated With Origin Server
Log fields of type boolean typically only appear if they have a value of
true. If a boolean field has a value of
false, that field is omitted from
UTF-8 encoding is enforced for these fields. Characters that are not UTF-8 characters are replaced with question marks.
When Cloud CDN serves a client request by initiating validation
requests and/or byte range requests, it omits the
serverIp field from the
Stackdriver Logging log entry for the client request. This is because
Cloud CDN can send requests to multiple server IP addresses in
reaction to a single client request.
Each request initiated by Cloud CDN creates a
Stackdriver Logging log entry. The resulting log entry contains a
parentInsertId field inside the
jsonPayload. You can use this field to
insertId of the log entry for the single client request that
prompted Cloud CDN to initiate the validation request or byte
range request. Furthermore, the log entry identifies Cloud CDN
as the user agent.
Refer to the Stackdriver Logging documentation for more information, including how to export logs to BigQuery, Cloud Pub/Sub and/or Cloud Storage, and how to configure logs-based metrics for monitoring and alerting.