I am trying to log within a cloud run service and all log summaries show up POST 0 B null ms curl/7.68.0 http://example.a.run.app/
which is not really informative and I need to expand each log to see what it is.
My code is the following and I am using bazel to build the container:
import logging
import os
from flask import Flask, make_response
import google.cloud.logging
app = Flask(__name__)
client = google.cloud.logging.Client()
client.setup_logging()
@app.route('/', methods=['POST'])
def hello_world():
logging.warning('warning message')
logging.info('info message')
logging.error('error message')
return make_response('OK', 200)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
other SO posts I am following to get log working:
Log to Cloud Logging with correct severity from Cloud Run Job and package used in the job
Google Cloud Functions Python Logging issue
EDIT: Logs show up fine on "Logs Explorer" but not on "Logs" under "Cloud Run"