import logging
logger = logging.getLogger('tornado.general')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter([%(levelname)s | %(asctime)s | %(filename):%(lineno)04s | %(message)s")
fileHandler = logging.handlers.RotatingFileHandler(filename='', maxBytes=1, backupCount=1)
fileHandler.setFormatter(formatter)
fileHandler.set_name('myname')
logger.addHandler(fileHandler)
logger = logging.getLogger('tornado.general')
hs = logger.handlers[:]
for x in hs:
if x.name == 'myname':
logger.handlers.remove(x)
댓글 없음:
댓글 쓰기