'Google Cloud Scheduler - Getting Returned Message in Logs

I am using Google Cloud Scheduler to call a php script on my remote server via HTTP (Target = HTTP). Nothing fancy, the script literally just echos "status:success"

However I am struggling to see the return payload of my php script within the Scheduler Logs.

I can see the status was 200 within the log, but that's all - no way to see what message/payload my script returned. Which will make my future debugging very difficult.

{
httpRequest: {
status: 200
}
insertId: "*****"
jsonPayload: {
@type: "type.googleapis.com/google.cloud.scheduler.logging.AttemptFinished"
jobName: "projects/*****/locations/europe-west2/jobs/Test"
targetType: "HTTP"
url: "https://*****/cloudscheduler.php"
}
logName: "projects/*****/logs/cloudscheduler.googleapis.com%2Fexecutions"
receiveTimestamp: "2022-01-27T14:16:27.194140494Z"
resource: {
labels: {
job_id: "Test"
location: "europe-west2"
project_id: "*****"
}
type: "cloud_scheduler_job"
}
severity: "INFO"
timestamp: "2022-01-27T14:16:27.194140494Z"
}

Am I overlooking something? Or does google logs not store the returned messages? Thanks.



Solution 1:[1]

Stackdriver does not log HTTP Response body. You need to add Stackdriver functionality to your code, in order to log to stackdriver the HTTP response that your function sends. Check this document to find stackdriver examples

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andres Fiesco Casasola