API - add log file

This commit is contained in:
Sam 2020-09-18 08:49:48 +02:00
parent b44a2cef53
commit 39cc65855a
2 changed files with 7 additions and 0 deletions

View File

@ -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=

View File

@ -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')