From ea94680dc3ccb8aed3f0b464a410a3cec35a1e1f Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Fri, 23 Jun 2023 19:05:54 +0200 Subject: [PATCH] logging --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 55b4430..3c8f2f8 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -import queue, sqlite3, time, atexit, sys, uuid, json, urllib.parse, logging +import queue, sqlite3, time, atexit, sys, uuid, json, urllib.parse, logging, datetime from flask import Flask, render_template, request, make_response, session from flask_socketio import SocketIO, join_room, leave_room from flask_session import Session @@ -18,7 +18,7 @@ Session(app) socketio = SocketIO(app) #logging_config -logging.basicConfig(filename='matekasse.log',filemode='w', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ,encoding='utf-8', level=logging.INFO) +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) db_log = logging.getLogger('db') website_log = logging.getLogger('website')