[loggers]
keys=root,infoLogger
[logger_root]
level=DEBUG
handlers=consoleHander,fileHandler
[logger_infoLogger]
handlers=consoleHander,fileHandler
qualname=infoLogger
propagat=0
[handlers]
keys=consoleHander,fileHandler
[handler_consoleHander]
class=StreamHandler
level=INFO
formatter=form02
args=(sys.stdout,)
[handler_fileHandler]
class=FileHandler
level=INFO
formatter=form01
args=('runlog.log','a')
[formatters]
keys=form01,form02
[formatter_form01]
format=%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s
[formatter_form02]
format=%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s
调用如下图:
网友评论