I am running a very simple Flask python App in Standard Environment Google App Engine. I am trying to view log information via the command: gcloud app logs tail -s default
.
I tried printing using 3 different methods:
logging.info("Printing via Google App Engine Log")
print("Printing via python print")
app.logger.info("Printing via Flask Log")
Sadly, none of them worked.
So how do I print out lines in the live log stream?
Thanks
Edit: Added a section of my code
from flask import Flask
from flask import request
import requests
import json
import logging
app = Flask(__name__)
@app.route("/", methods=["GET"])
def webhook():
app.logger.info("Printing via Flask Log")
print("Printing via python print")
logging.info("Printing via Google App Engine Log")
if request.args.get("hub.mode") == "subscribe" and request.args.get("hub.challenge"):
if not request.args.get("hub.verify_token") == VERIFICATION_TOKEN:
return "Verification token mismatch", 403
return request.args["hub.challenge"], 200
return "Hello world", 200
If you think that showing other files such as .yaml file helps, please let me know. Thanks!