2

I'm wondering how to set up logging for Google App Engine cron jobs. I haven't found any information about this specific topic in the App Engine documentation.

There's a page https://console.cloud.google.com/appengine/cronjobs in GCP. Every cron job has a "View" link in the "Log" column, which leads a user to the Logs Viewer with the following filters:

protoPayload.taskName="..."
protoPayload.taskQueueName="__cron"

In my case, no logs for cron jobs are displayed.

The service that serves the endpoints for the cron jobs is a node.js application that uses Winston logging with the transport provided by @google-cloud/logging-winston package. This application is responsible not only for processing cron jobs, and the logging works there fine: for instance, I'm able to filter specific queries by Google's trace id.

Is there anything I can provide with the logs payload to be able to filter them by taskName and taskQueueName? And where would I take these values, i.e. are there any request headers I could read them from and write with logs?

It would be great if it's something achievable with @google-cloud/logging-winston. If not, a library/language agnostic answer would also be helpful.

mvlabat
  • 577
  • 4
  • 17

0 Answers0