-
Notifications
You must be signed in to change notification settings - Fork 1
/
logger.conf
62 lines (47 loc) · 1.22 KB
/
logger.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#logger.conf
###############################################
[loggers]
keys=root,novel-update-monitor-account
[logger_root]
level=INFO
handlers=stream
[logger_novel-update-monitor-account]
handlers=stream,timedrt
qualname=novel-update-monitor-account
propagate=0
###############################################
[handlers]
keys=stream,filert,timedrt,http
# 流,设置输出到标准错误流
[handler_stream]
class=StreamHandler
level=NOTSET
formatter=form02
args=(sys.stderr,)
# 按文件大小循环
[handler_filert]
class=handlers.RotatingFileHandler
level=INFO
formatter=form02
args=('log/novel-update-monitor-account.log', 'a', 10*1024*1024, 5)
# 按时间循环
[handler_timedrt]
class=handlers.TimedRotatingFileHandler
level=DEBUG
formatter=form01
args=('log/novel-update-monitor-account.log', 'd', 1 , 10 )
# 发送到网络
[handler_http]
class=handlers.HTTPHandler
level=ERROR
formatter=form01
args=('localhost:8888', '/api/log', 'POST')
###############################################
[formatters]
keys=form01,form02
[formatter_form01]
format=[%(asctime)s][%(filename)s][line:%(lineno)d][%(levelname)s] %(message)s
datefmt=%a, %d %b %Y %H:%M:%S
[formatter_form02]
format=%(name)-12s: %(levelname)-8s %(message)s
datefmt=