Setup app logger in python environment

The user's functions can now use `current_app.logger`, and use
`kubectl logs` to see the logs that the function outputs.
This commit is contained in:
Soam Vasani
2016-12-08 14:03:27 -08:00
parent ab96ed2917
commit 5f02f6c8ca
2 changed files with 22 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
from flask import request
from flask import current_app
def main():
msg = "%s %s:\n---HEADERS---\n%s\n--BODY--\n%s\n-----\n" % (request.method, request.path, request.headers, request.get_data())
current_app.logger.info(msg)
return msg