Rootlogger
This commit is contained in:
parent
4d2a52ddb1
commit
a4858b4b8c
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue