diff --git a/app/reports.py b/app/reports.py index 80007ac..4b3921e 100644 --- a/app/reports.py +++ b/app/reports.py @@ -47,6 +47,7 @@ def gen_item_report(): # Only one report per day if report != None: current_app.logger.info(f"Item Report Already Generated for {date}") + return char_xmls = CharacterXML.query.join( CharacterInfo, @@ -96,6 +97,7 @@ def gen_currency_report(): # Only one report per day if report != None: current_app.logger.info(f"Currency Report Already Generated for {date}") + return characters = CharacterXML.query.join( CharacterInfo, @@ -139,6 +141,7 @@ def gen_uscore_report(): # Only one report per day if report != None: current_app.logger.info(f"U-Score Report Already Generated for {date}") + return characters = CharacterXML.query.join( CharacterInfo, diff --git a/wsgi.py b/wsgi.py index 7a3b76a..80be7b1 100644 --- a/wsgi.py +++ b/wsgi.py @@ -13,4 +13,13 @@ def make_shell_context(): if __name__ == '__main__': with app.app_context(): app.run(host='0.0.0.0') - +else: + import logging + from loggin.handlers import RotatingFileHandler + gunicorn_logger = logging.getLogger('gunicorn.error') + app.logger.handlers = gunicorn_logger.handlers + file_handler = RotatingFileHandler('nexus_dashboard.log', maxBytes=1024 * 1024 * 100, backupCount=20) + formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") + file_handler.setFormatter(formatter) + app.logger.addHandler(file_handler) + app.logger.setLevel(gunicorn_logger.level)