From 074a1e5313bd58247ae982f3ce1d77293dcc160a Mon Sep 17 00:00:00 2001 From: Jason SECULA Date: Wed, 9 Jul 2025 18:32:46 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20d'un=20fichier=20de=20log=20s?= =?UTF-8?q?=C3=A9par=C3=A9=20pour=20les=20erreurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/syncGLPI.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/syncGLPI.py b/scripts/syncGLPI.py index 9f918f9..7841f70 100644 --- a/scripts/syncGLPI.py +++ b/scripts/syncGLPI.py @@ -41,11 +41,15 @@ formatter = logging.Formatter(fmt='%(asctime)s | %(levelname)s: %(message)s', da if(settings["LOGS"]["Enabled"]): if(settings["LOGS"].get("Path") and settings["LOGS"].get("Path") != ""): fileHandler = logging.FileHandler(f"{settings['LOGS'].get('Path')}syncGLPI.log") + fileErrorHandler = logging.FileHandler(f"{settings['LOGS'].get('Path')}syncGLPI-errors.log") else: fileHandler = logging.FileHandler('./logs/syncGLPI.log') fileHandler.setLevel(logginglevel) fileHandler.setFormatter(formatter) + fileErrorHandler.setLevel(logging.ERROR) + fileErrorHandler.setFormatter(formatter) logger.addHandler(fileHandler) + logger.addHandler(fileErrorHandler) # handler pour log dans la console if(not args.silent):