Update app.py

Added separate function for mongo extension, and modified configure_logging function.