I have this code:
// main.go
package magnum
import (
"net/http"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
)
func init() {
http.HandleFunc("/tasks/backup", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
ctx := appengine.NewContext(r)
log.Debugf(ctx, "Testing cron tasks using Go")
}
// cron.yaml
cron:
- description: extraction
url: /tasks/backup
schedule: every 5 minutes
And I'm not seeing "Testing cron tasks using Go" text when I check the logs on GAE dashboard. Facts:
What could I be missing?
I believe the local development server doesn't by default display logged messages, try starting your local development server with this additional argument:
dev_appserver.py --log_level=info
You can also pass the --logs_path=...
argument if you want to log the output to a file in addition to the console. Depending on the amount of logging you need to do that might be useful as well.
For your deployed application, you can find your logged application messages in the Logging section of the Cloud Platform Console. If you don't see them ensure that the drop-down filter has GAE Application selected.