From f38d2a145e3183009f44f3ab8383decda5f91dfe Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Fri, 23 Jun 2023 19:49:49 +0200 Subject: [PATCH] Log path and name --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index f538755..630163f 100644 --- a/main.py +++ b/main.py @@ -18,7 +18,8 @@ Session(app) socketio = SocketIO(app) #logging_config -logging.basicConfig(filename=f"matekasse-{datetime.datetime.now()}.log",filemode='w', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ,encoding='utf-8', level=logging.INFO) +now = datetime.datetime.now().strftime('%d-%m-%Y-%H-%M-%S') +logging.basicConfig(filename=f"logs/matekasse-{now}.log",filemode='w', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ,encoding='utf-8', level=logging.INFO) db_log = logging.getLogger('db') website_log = logging.getLogger('website')