Using Stackdriver Logging

You can use Stackdriver logging with Cloud Tasks queues.

Turning on logging

Stackdriver logging can be turned on using a flag with either gcloud beta create or update:

gcloud beta tasks queues create [QUEUE_ID] --log-sampling-ratio=1.0


gcloud beta tasks queues update [QUEUE_ID] --log-sampling-ratio=1.0

where the log-sampling-ratio value indicates what percentage of the operations on the queue are logged. Setting it to any value between 1.0 and 0.0 logs that fraction of operations, where 1.0 logs all the operations and 0.0 logs none of them.

Turning off logging

Turn off logging by setting the flag to 0.0.

gcloud beta tasks queues update [QUEUE_ID] --log-sampling-ratio=0.0

Logged operations

The following operations are logged:

  • Task Operations
    • CreateTask
    • DeleteTask
  • Attempt Operations
    • AttemptDispatch
    • AttemptResponse

Viewing logs

To see the logs, go to the Stackdriver Logging > Logs (Logs Viewer) page in the GCP Console:

Go to the Logs Viewer page

For more information on reading the logs page, see Viewing logs.



Cloud Tasks Documentation