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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user