diff --git a/hugvey_server.py b/hugvey_server.py index 5828a54..f32289f 100644 --- a/hugvey_server.py +++ b/hugvey_server.py @@ -39,8 +39,20 @@ if __name__ == '__main__': ) logger = logging.getLogger("hugvey") + + logFileHandler = logging.handlers.RotatingFileHandler( + './recordings/server.log', + maxBytes=1024*512, + backupCount=5 + ) + logFileHandler.setFormatter(logging.Formatter( + fmt="%(asctime)s %(name)s[%(process)d,%(threadName)s] %(levelname)s %(message)s" + )) + logger.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) logger.info("Start server")