Fix config file name

This commit is contained in:
Patrick Jentsch 2019-12-02 14:24:33 +01:00
parent ae30ba7186
commit 8bf71dea47

View File

@ -38,14 +38,14 @@ class DevelopmentConfig(Config):
os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME')
)
if not os.path.isfile('logs/opaque_web.log'):
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log')
if not os.path.isfile('logs/nopaque.log'):
file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
log = open(file_path, 'w+')
log.close()
if os.environ.get('FLASK_CONFIG') == 'development':
log_format = ("%(asctime)s - %(levelname)s - %(name)s - "
"%(filename)s - %(lineno)d - %(message)s")
logging.basicConfig(filename='logs/opaque_web.log', level='WARNING',
logging.basicConfig(filename='logs/nopaque.log', level='WARNING',
format=log_format, datefmt='%Y-%m-%d %H:%M:%S',
filemode='w')
logger = logging.getLogger(__name__)
@ -71,14 +71,14 @@ class ProductionConfig(Config):
os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME')
)
if not os.path.isfile('logs/opaque_web.log'):
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log')
if not os.path.isfile('logs/nopaque.log'):
file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
log = open(file_path, 'w+')
log.close()
if os.environ.get('FLASK_CONFIG') == 'production':
log_format = ("%(asctime)s - %(levelname)s - %(name)s - "
"%(filename)s - %(lineno)d - %(message)s")
logging.basicConfig(filename='logs/opaque_web.log', level='ERROR',
logging.basicConfig(filename='logs/nopaque.log', level='ERROR',
format=log_format, datefmt='%Y-%m-%d %H:%M:%S',
filemode='w')
logger = logging.getLogger(__name__)