zoukankan      html  css  js  c++  java
  • log日志的配置

    log日志的配置文件:

    注意:修改日志路径,如:

    args=('e:\AutoTestLog.log', 'a', 10*1024*1024, 5)
    args=('e:\AutoTestLog.log', 'a')

    Logger.conf文件

    ################################################
    ###########propagate 是否继承父类的log信息,0:否
    [loggers]
    keys=root,example01,example02
    [logger_root]
    level=DEBUG
    handlers=hand01,hand02
    [logger_example01]
    handlers=hand01,hand02
    qualname=example01
    propagate=0
    [logger_example02]
    handlers=hand01,hand03
    qualname=example02
    propagate=0
    ###############################################
    [handlers]
    keys=hand01,hand02,hand03
    [handler_hand01]
    class=StreamHandler
    level=DEBUG
    formatter=form01
    args=(sys.stderr,)
    [handler_hand02]
    class=FileHandler
    level=DEBUG
    formatter=form01
    args=('e:\AutoTestLog.log', 'a')
    [handler_hand03]
    class=handlers.RotatingFileHandler
    level=INFO
    formatter=form01
    args=('e:\AutoTestLog.log', 'a', 10*1024*1024, 5)
    ###############################################
    [formatters]
    keys=form01,form02
    [formatter_form01]
    format=%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s
    datefmt=%Y-%m-%d %H:%M:%S
    [formatter_form02]
    format=%(name)-12s: %(levelname)-8s %(message)s
    datefmt=%Y-%m-%d %H:%M:%S


    一切技术都是为业务服务,脱离业务的技术一文不值!

  • 相关阅读:
    maven插件安装与使用
    java面试题
    关于java的GC
    技术人员要树立自己的品牌
    为什么IT公司都应该鼓励开源
    你应该坚持写博客 即使没有读者
    计算机基础
    收藏 | 产品经理不可不知的 7 种技术思维
    我讨厌你公事公办的样子
    子序列问题【LIS、LCS、LCIS】
  • 原文地址:https://www.cnblogs.com/bubutianshu/p/11179578.html
Copyright © 2011-2022 走看看