I have a simple service in GCP Flex:
import logging
from flask import Flask
app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG)
@app.route('/hello')
def hello():
logging.debug('hello')
return 'hello'
Looking at Stackdriver this log is shown in stderr
, like this:
15:32:38.000 DEBUG:root:hello
A couple of problems with this:
- timestamps should have milisecond precision (always
.000
) - logs cannot be filtered using stackdriver log level filter
Is there any way to address these issues? Does logging
need to be configured in some way?