Each Google 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 balancing logs contain HttpRequest log fields, which can indicate the following cache hit/miss status:
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 and how to use logs-based metrics for monitoring and alerting.