I have a small application where I am using chalice to expose some endpoints. For logging purpose I want to print the entire url whenever any handler function is called.
@app.route('/XYZ', methods=['GET'])
@logging_and_error_handling()
def get_XYZ_value():
For example , if the above function gets called, I want to log the entire url using app.log.info()
.
Something like call to http://myhostname.com/api/XYZ started
I tried using app.current_request.to_dict()
, but it looks like it doesn't have that info. Git reference.
Is there an alternate way to achieve this ?
I use app.current_request.context['resourcePath']
for the URL and also log the following as well:
app.current_request.method
app.current_request.uri_params
app.current_request.query_params
app.current_request.context.get('requestId')