diff --git a/Makefile.custom.config.example b/Makefile.custom.config.example index c69d31cb..e060d517 100644 --- a/Makefile.custom.config.example +++ b/Makefile.custom.config.example @@ -4,6 +4,7 @@ WORKERS_PROCESSES = 1 export DATABASE_URL = postgres://fittrackee:fittrackee@$(HOST):5432/fittrackee export DATABASE_TEST_URL = postgres://fittrackee:fittrackee@$(HOST):5432/fittrackee_test export APP_SETTINGS=fittrackee.config.DevelopmentConfig +export APP_LOG=fittrackee.log export DATABASE_DISABLE_POOLING=True export TILE_SERVER_URL= export MAP_ATTRIBUTION= diff --git a/fittrackee/__init__.py b/fittrackee/__init__.py index 7a0d2cba..a1401827 100644 --- a/fittrackee/__init__.py +++ b/fittrackee/__init__.py @@ -15,6 +15,12 @@ bcrypt = Bcrypt() migrate = Migrate() email_service = Email() dramatiq = Dramatiq() +log_file = os.getenv('APP_LOG') +logging.basicConfig( + filename=log_file, + format='%(asctime)s - %(name)s - %(levelname)s - ' '%(message)s', + datefmt='%Y/%m/%d %H:%M:%S', +) appLog = logging.getLogger('fittrackee')