2018년 6월 21일 목요일

python logging

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)

댓글 없음:

댓글 쓰기

docker redmine 설치

docker-composer.yml version: '3.1' services:      redmine:           image: redmine           restart: always           container_na...