tweak request logging, log response info
This commit is contained in:
parent
2634c144a7
commit
ed0dab14f3
@ -32,7 +32,12 @@ def create_app(instance_path=None, test_config=None):
|
|||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def log_request():
|
def log_request():
|
||||||
logger.info("REQUEST: [ %s ]", request.path)
|
logger.info("REQUEST: %s %s", request.method, request.path)
|
||||||
|
|
||||||
|
@app.after_request
|
||||||
|
def log_response(response):
|
||||||
|
logger.info("RESPONSE: %s %s: %s", request.method, request.path, response.status)
|
||||||
|
return response
|
||||||
|
|
||||||
@app.route(f'/{app.config["MEDIA_DIR"]}/<path:filename>')
|
@app.route(f'/{app.config["MEDIA_DIR"]}/<path:filename>')
|
||||||
def media_files(filename):
|
def media_files(filename):
|
||||||
|
Loading…
Reference in New Issue
Block a user