You can use Cloud Logging with Cloud Tasks queues.
Turning on logging
Cloud Logging can be turned on using a flag with either
gcloud tasks queues create [QUEUE_ID] --log-sampling-ratio=1.0
gcloud tasks queues update [QUEUE_ID] --log-sampling-ratio=1.0
log-sampling-ratio value indicates what percentage of the operations
on the queue are logged. Setting it to any value between
that fraction of operations, where
1.0 logs all the operations and
logs none of them.
0.0 is the default setting.
Turning off logging
Turn off logging by setting the flag to
gcloud tasks queues update [QUEUE_ID] --log-sampling-ratio=0.0
The following operations are logged:
- Task Operations
- Attempt Operations
To see the logs, go to the Logging > Logs Viewer page in the Cloud Console:
For more information on reading the logs page, see Viewing logs.