diff --git a/app.py b/app.py index 6f4be95..2054e2a 100644 --- a/app.py +++ b/app.py @@ -1,14 +1,18 @@ import logging +import logging.config import psycopg2 import psycopg2.extras from flask import Flask, render_template, g, redirect, request, url_for -logging.basicConfig(format="%(asctime)s %(levelname)s %(name)s %(lineno)d | %(message)s", level=logging.DEBUG) +import config + +logging.config.dictConfig(config.logging) app = Flask(__name__) log = logging.getLogger(__name__) +log.info("starting") @app.route("/") def home(): @@ -57,7 +61,7 @@ def get_db(): @app.teardown_appcontext def teardown_db(exception): - log.info("in teardown_db: exception = %s", exception) + log.debug("in teardown_db: exception = %s", exception) db = g.pop('db', None) if db is not None: if not exception: