log = lambda msg: app.logger.info(msg, extra={'worker_id': 'request.uuid'})

@app.route('/')
def hello():
    log('hello world')
return 'Hello World!'
if __name__ == '__main__':
    app.debug_log_format = """-------------------------------------------------------------------------
    %(worker_id)s in %(module)s [%(pathname)s:%(lineno)d]:
    %(message)s
    -------------------------------------------------------------------------"""
app.debug = True
log('hello world')
app.run()
Provide extra information to Flask's app.logger