import os
import pgdb

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    conn = pgdb.connect( host='pg', user='postgres', password='testnet', database='testnet' )
    cur = conn.cursor()
    cur.execute( "SELECT value FROM kv WHERE key='provider'" )
    provider = cur.fetchone()[0]
    conn.close()
    return 'Hello '+provider+'!'

if __name__ == '__main__':
    # Bind to PORT if defined, otherwise default to 5000.
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
@@ -14,16 +14,31 @@
 ort pgdb
+%0Aimport logging
 %0A%0Afrom f
@@ -400,16 +400,97 @@
 ain__':%0A
+    logging.basicConfig(format='%25(levelname)s:%25(message)s', level=logging.DEBUG)%0A
     # Bi
@@ -622,8 +622,9 @@
 rt=port)
+%0A

Add logging to python webserver