flask logging improvement, tornado http shutdown with sigterm