From a4858b4b8c453f0e7d14d5ec6311600cab1fedf6 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 12 Nov 2019 18:09:48 +0100 Subject: [PATCH] Rootlogger --- hugvey_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hugvey_server.py b/hugvey_server.py index e16d502..ac6a127 100644 --- a/hugvey_server.py +++ b/hugvey_server.py @@ -38,6 +38,7 @@ if __name__ == '__main__': fmt="%(asctime)s %(hostname)s %(name)s[%(process)d,%(threadName)s] %(levelname)s %(message)s" ) + rootLogger = logging.getLogger() logger = logging.getLogger("hugvey") logFileHandler = logging.handlers.RotatingFileHandler( @@ -49,12 +50,12 @@ if __name__ == '__main__': fmt="%(asctime)s %(name)s[%(process)d,%(threadName)s] %(levelname)s %(message)s" )) logFileHandler.setLevel(logging.DEBUG) - logger.addHandler(logFileHandler) + rootLogger.addHandler(logFileHandler) # logger.setLevel(1) # to send all records to cutelog socket_handler = logging.handlers.SocketHandler('127.0.0.1', 19996) # default listening address socket_handler.setLevel(logging.DEBUG) - logger.addHandler(socket_handler) + rootLogger.addHandler(socket_handler) logger.info("Start server") command = CentralCommand(args=args, debug_mode=args.verbose > 0)