美文网首页
log.conf文件

log.conf文件

作者: 水漾涟漪penny | 来源:发表于2019-10-31 18:29 被阅读0次

    [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

    调用如下图:

    相关文章

      网友评论

          本文标题:log.conf文件

          本文链接:https://www.haomeiwen.com/subject/cvntbctx.html