PyComicPackRouMan/logconf.yml
2023-04-06 19:33:08 +08:00

45 lines
1.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: 1
#是否覆盖掉已经存在的loggers
disable_existing_loggers: True
formatters:
tostrout:
format: "%(asctime)s - %(name)s - %(levelname)-9s - %(filename)-8s : %(lineno)s line - %(message)s"
datefmt: "%Y/%m/%d %H:%M:%S"
tofile:
format: "%(asctime)s - %(name)s - %(levelname)-9s - %(filename)-8s : %(lineno)s line - %(message)s"
handlers:
sh:
class: logging.StreamHandler
level: INFO
formatter: tostrout
stream: ext://sys.stdout
fh:
class: logging.handlers.TimedRotatingFileHandler
filename: logconf.log
interval: 1
backupCount: 2
when: D
level: INFO
formatter: tofile
loggers:
logger1:
level: DEBUG
handlers: [sh]
#是否往上级Logger传递如果为yes的话root选择了两个logger这里的日志也会在两个logger的配置中输出会重复。所以选No,自己记录自己的日志。
propagate: no
logger2:
level: INFO
handlers: [fh]
propagate: no
root:
level: DEBUG
handlers: [sh,fh]
propagate: no